mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-28 23:24:50 +00:00
net: macb: fix the restore of cmp registers
Commita14d273ba1
("net: macb: restore cmp registers on resume path") introduces the restore of CMP registers on resume path. In case the IP doesn't support type 2 screeners (zero on DCFG8 register) the struct macb::rx_fs_list::list is not initialized and thus the list_for_each_entry(item, &bp->rx_fs_list.list, list) loop introduced in commita14d273ba1
("net: macb: restore cmp registers on resume path") will access an uninitialized list leading to crash. Thus, initialize the struct macb::rx_fs_list::list without taking into account if the IP supports type 2 screeners or not. Fixes:a14d273ba1
("net: macb: restore cmp registers on resume path") Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2e1534f395
commit
a714e27ea8
1 changed files with 1 additions and 1 deletions
|
@ -3918,6 +3918,7 @@ static int macb_init(struct platform_device *pdev)
|
||||||
reg = gem_readl(bp, DCFG8);
|
reg = gem_readl(bp, DCFG8);
|
||||||
bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3),
|
bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3),
|
||||||
GEM_BFEXT(T2SCR, reg));
|
GEM_BFEXT(T2SCR, reg));
|
||||||
|
INIT_LIST_HEAD(&bp->rx_fs_list.list);
|
||||||
if (bp->max_tuples > 0) {
|
if (bp->max_tuples > 0) {
|
||||||
/* also needs one ethtype match to check IPv4 */
|
/* also needs one ethtype match to check IPv4 */
|
||||||
if (GEM_BFEXT(SCR2ETH, reg) > 0) {
|
if (GEM_BFEXT(SCR2ETH, reg) > 0) {
|
||||||
|
@ -3928,7 +3929,6 @@ static int macb_init(struct platform_device *pdev)
|
||||||
/* Filtering is supported in hw but don't enable it in kernel now */
|
/* Filtering is supported in hw but don't enable it in kernel now */
|
||||||
dev->hw_features |= NETIF_F_NTUPLE;
|
dev->hw_features |= NETIF_F_NTUPLE;
|
||||||
/* init Rx flow definitions */
|
/* init Rx flow definitions */
|
||||||
INIT_LIST_HEAD(&bp->rx_fs_list.list);
|
|
||||||
bp->rx_fs_list.count = 0;
|
bp->rx_fs_list.count = 0;
|
||||||
spin_lock_init(&bp->rx_fs_lock);
|
spin_lock_init(&bp->rx_fs_lock);
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in a new issue