cfg80211: fix refcount imbalance when wext is disabled
Johannes Berg
maintainerPATCH 1/1 cfg80211: fix refcount imbalance when wext is disabled
When CONFIG_CFG80211_WEXT is not set, there is a refcount imbalance with rdev->opencount, fix that by moving it out of the ifdef.
Reported-by Alan Stern <[email protected]>
Signed-off-by Johannes Berg <[email protected]>
--- net/wireless/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/wireless/core.c +2 -2
@@ -745,9 +745,9 @@ static int cfg80211_netdev_notifier_callmutex_unlock (&rdev->devlist_mtx);dev_put (dev); } -#ifdef CONFIG_CFG80211_WEXT cfg80211_lock_rdev (rdev);mutex_lock (&rdev->devlist_mtx); +#ifdef CONFIG_CFG80211_WEXT wdev_lock (wdev);switch (wdev->iftype) {case NL80211_IFTYPE_ADHOC :
@@ -760,10 +760,10 @@ static int cfg80211_netdev_notifier_call break; }wdev_unlock (wdev); +#endif rdev->opencount++;mutex_unlock (&rdev->devlist_mtx);cfg80211_unlock_rdev (rdev); -#endif break ;case NETDEV_UNREGISTER :/*
Quoted 6 lines · Johannes Berg
When
CONFIG_CFG80211_WEXTis not set, there is a refcount imbalance withrdev->opencount, fix that by moving it out of the ifdef.Reported-by Alan Stern <[email protected]>Signed-off-by Johannes Berg <[email protected]>
I confirm that this fixes hang in rmmod. And enabling CONFIG_CFG80211_WEXT fixes the issue about the wireless card not working.
Tested-by Alan Stern <[email protected]>
Alan Stern