summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-04 00:51:22 +0100
committerDavid S. Miller <davem@davemloft.net>2019-12-05 01:56:42 +0100
commit0cb96b5749bf500f3612cda52fc98eb795fcd62d (patch)
treef688aa67d6d94fa0a5656999e4903d5ad9b21e7f /drivers
parentionic: keep users rss hash across lif reset (diff)
downloadlinux-0cb96b5749bf500f3612cda52fc98eb795fcd62d.tar.xz
linux-0cb96b5749bf500f3612cda52fc98eb795fcd62d.zip
net: sfp: fix unbind
When unbinding, we don't correctly tear down the module state, leaving (for example) the hwmon registration behind. Ensure everything is properly removed by sending a remove event at unbind. Fixes: 6b0da5c9c1a3 ("net: sfp: track upstream's attachment state in state machine") Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/phy/sfp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index bdbbb76f8fd3..c118d9f0195b 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -2294,6 +2294,10 @@ static int sfp_remove(struct platform_device *pdev)
sfp_unregister_socket(sfp->sfp_bus);
+ rtnl_lock();
+ sfp_sm_event(sfp, SFP_E_REMOVE);
+ rtnl_unlock();
+
return 0;
}