Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 2.6.33] cfg80211: fix refcount imbalance when wext is disabled
@ 2010-01-11 15:14 Johannes Berg
  2010-01-12 14:32 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes Berg @ 2010-01-11 15:14 UTC (permalink / raw)
  To: John Linville; +Cc: Alan Stern, linux-wireless

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 <stern@rowland.harvard.edu>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/wireless/core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- wireless-testing.orig/net/wireless/core.c	2010-01-11 16:11:50.000000000 +0100
+++ wireless-testing/net/wireless/core.c	2010-01-11 16:12:04.000000000 +0100
@@ -745,9 +745,9 @@ static int cfg80211_netdev_notifier_call
 			mutex_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:
 		/*



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.33] cfg80211: fix refcount imbalance when wext is disabled
  2010-01-11 15:14 [PATCH 2.6.33] cfg80211: fix refcount imbalance when wext is disabled Johannes Berg
@ 2010-01-12 14:32 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2010-01-12 14:32 UTC (permalink / raw)
  To: Johannes Berg; +Cc: John Linville, linux-wireless

On Mon, 11 Jan 2010, Johannes Berg wrote:

> 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 <stern@rowland.harvard.edu>
> Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

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 <stern@rowland.harvard.edu>

Alan Stern



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-12 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-11 15:14 [PATCH 2.6.33] cfg80211: fix refcount imbalance when wext is disabled Johannes Berg
2010-01-12 14:32 ` Alan Stern

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox