net: phylink: avoid resolving link state too early
commit418d77caf233c1fa01ec1c9c880b8af855cfd02e
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 11 Feb 2019 15:04:24 +0000 (11 15:04 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:08:09 +0000 (27 10:08 +0100)
treed8298520e1fa88fcd1fcd42e1b4b5ea0287bf032
parent81bafd09bb8d98370d8d5d21a1b3bbc48f3dcf28
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