net: phylink: avoid resolving link state too early
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 11 Feb 2019 15:04:24 +0000 (15:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:09:03 +0000 (10:09 +0100)
commit101e1972655200fccb5b9017c98bed49924845ac
tree1a3e32b094790e71ff85ee24503e0ae1d9f545c8
parentc80bf03569af40faf5ad2c1184e72f48aa0048b6
net: phylink: avoid resolving link state too early

commit 87454b6edc1b0143fdb3d9853285477e95af74a4 upstream.

During testing on Armada 388 platforms, it was found with a certain
module configuration that it was possible to trigger a kernel oops
during the module load process, caused by the phylink resolver being
triggered for a currently disabled interface.

This problem was introduced by changing the way the SFP registration
works, which now can result in the sfp link down notification being
called during phylink_create().

Fixes: b5bfc21af5cb ("net: sfp: do not probe SFP module before we're attached")
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phylink.c