[PATCH] bonding: Fix sysfs attribute handling



bonding: Fix sysfs attribute handling

For bonding interfaces any attempt to read the sysfs directory contents after
module removal results in an oops. The fix is to release sysfs attributes
for the interfaces upon module unload.

Signed-off-by: Libor Pechacek <lpechacek@xxxxxxx>
--
drivers/net/bonding/bond_main.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 0942d82..33767d4 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4528,8 +4528,7 @@ static void bond_free_all(void)
netif_tx_unlock_bh(bond_dev);
/* Release the bonded slaves */
bond_release_all(bond_dev);
- bond_deinit(bond_dev);
- unregister_netdevice(bond_dev);
+ bond_destroy(bond);
}

#ifdef CONFIG_PROC_FS
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • BUG in sysfs_remove_group
    ... This results in the following oops when SELinux is enabled and enforced. ... The shell's SELinux domain is not allowed "search" permission in sysfs ... unable to handle kernel paging request at virtual address fffffffb ...
    (Linux-Kernel)
  • Oops when reading cpufreq values with 2.6.8-rc4-mm1
    ... I recently experienced a reproducible oops when trying to read cpufreq ... Understanding the proper sysfs ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: 2.6.16-rc5 pppd oops on disconnects
    ... with the sysfs stuff, but the slab poisoning is pretty ... back to at least 2.6.15-rc7 I get a similar oops so this looks old ... device at the time of disconnect. ...
    (Linux-Kernel)
  • [patch 20/32] USB: Fix oops in PhidgetServo
    ... If anyone has any objections, ... The PhidgetServo causes an Oops when any of its sysfs attributes are read ...
    (Linux-Kernel)
  • Re: CD RW packet driver still oops in 2.6.27-rc5-git5
    ... sysfs: duplicate filename '254:0' can not be created ... This is not an oops as in oops, just sysfs tells that duplicate file ...
    (Linux-Kernel)