]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:13:24 +0000 (13:13 +0200)
commitcfe9101a6a8fb4237510c02c1a4db0aec8622edd
tree8a3f3a9db3cbe2dbf739b6208b5de5dff6d08179
parentc3bf7238c40837f7ad2325ccfdbbf21ea811dc47
net: macb: fix the restore of cmp registers

commit a714e27ea8bdee2b238748029d31472d0a65b611 upstream.

Commit a14d273ba159 ("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 a14d273ba159 ("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: a14d273ba159 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/cadence/macb_main.c