diff options
author | Veaceslav Falico <vfalico@redhat.com> | 2013-04-03 07:46:33 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-05 06:46:13 +0200 |
commit | 4de79c737b200492195ebc54a887075327e1ec1d (patch) | |
tree | 13f1ea930500381271013346af4a62e364b6ade2 | |
parent | atl1e: limit gso segment size to prevent generation of wrong ip length fields (diff) | |
download | linux-4de79c737b200492195ebc54a887075327e1ec1d.tar.xz linux-4de79c737b200492195ebc54a887075327e1ec1d.zip |
bonding: remove sysfs before removing devices
We have a race condition if we try to rmmod bonding and simultaneously add
a bond master through sysfs. In bonding_exit() we first remove the devices
(through rtnl_link_unregister() ) and only after that we remove the sysfs.
If we manage to add a device through sysfs after that the devices were
removed - we'll end up with that device/sysfs structure and with the module
unloaded.
Fix this by first removing the sysfs and only after that calling
rtnl_link_unregister().
Signed-off-by: Veaceslav Falico <vfalico@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bonding/bond_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index a51241b2e621..171b10f167a5 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c @@ -4902,8 +4902,8 @@ static void __exit bonding_exit(void) bond_destroy_debugfs(); - rtnl_link_unregister(&bond_link_ops); unregister_pernet_subsys(&bond_net_ops); + rtnl_link_unregister(&bond_link_ops); #ifdef CONFIG_NET_POLL_CONTROLLER /* |