mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
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: 6b0da5c9c1
("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>
This commit is contained in:
parent
ffac2027e1
commit
0cb96b5749
1 changed files with 4 additions and 0 deletions
|
@ -2294,6 +2294,10 @@ static int sfp_remove(struct platform_device *pdev)
|
||||||
|
|
||||||
sfp_unregister_socket(sfp->sfp_bus);
|
sfp_unregister_socket(sfp->sfp_bus);
|
||||||
|
|
||||||
|
rtnl_lock();
|
||||||
|
sfp_sm_event(sfp, SFP_E_REMOVE);
|
||||||
|
rtnl_unlock();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue