Search Linux Wireless

[PATCH] make netdev unregister notifier idempotent

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Due to the fact that other things may hold a netdev open and the kernel
retries to call all notifiers again and again until the netdev's
refcount reaches 0, the notifier must be idempotent. This patch achieves
that by re-initialising the list and checking whether it is empty.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>

---
 net/wireless/core.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- wireless-dev.orig/net/wireless/core.c	2007-03-08 02:07:12.703607522 +0100
+++ wireless-dev/net/wireless/core.c	2007-03-08 02:08:59.503607522 +0100
@@ -290,8 +290,10 @@ static int cfg80211_netdev_notifier_call
 		break;
 	case NETDEV_UNREGISTER:
 		mutex_lock(&rdev->devlist_mtx);
-		sysfs_remove_link(&dev->dev.kobj, "phy80211");
-		list_del(&dev->ieee80211_ptr->list);
+		if (!list_empty(&dev->ieee80211_ptr->list)) {
+			sysfs_remove_link(&dev->dev.kobj, "phy80211");
+			list_del_init(&dev->ieee80211_ptr->list);
+		}
 		mutex_unlock(&rdev->devlist_mtx);
 		break;
 	}


-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux