Skip to contentSkip to conversation

net: sfp: fix unbind

PATCH Applied Russell King 2 participants 2 messages Dec 3, 2019 – Dec 5, 2019

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/net/phy/sfp.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/phy/sfp.c +4 -0
index 8d05e888d3f8..78f53da1e34e 100644
@@ -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;
 }
 
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw

From: Russell King <[email protected]>
Date: Tue, 03 Dec 2019 23:51:22 +0000

Quoted 6 lines

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")

Applied.