]> git.baikalelectronics.ru Git - kernel.git/commit
net: macb: fix the restore of cmp registers
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Wed, 14 Apr 2021 11:20:29 +0000 (14:20 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Apr 2021 20:57:17 +0000 (13:57 -0700)
commit46efb6ca0f32fa515e6631b695b14bea82a35f15
tree34dd498261b52591abdfc91a15380607d2fb6a56
parentb67dc62b5630ed69192e6b97eb687eec8cedbe9b
net: macb: fix the restore of cmp registers

Commit 6da371e7960d ("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
commit 6da371e7960d ("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: 6da371e7960d ("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>
drivers/net/ethernet/cadence/macb_main.c