* [PATCH] cfg80211: fix locking
@ 2010-09-30 20:17 Johannes Berg
0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2010-09-30 20:17 UTC (permalink / raw)
To: John Linville; +Cc: linux-wireless@vger.kernel.org
From: Johannes Berg <johannes.berg@intel.com>
Add missing unlocking of the wiphy in set_channel,
and don't try to unlock a non-existing wiphy in
set_cqm.
Cc: stable@kernel.org [2.6.35+]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
net/wireless/nl80211.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
--- wireless-testing.orig/net/wireless/nl80211.c 2010-09-30 22:10:42.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c 2010-09-30 22:17:10.000000000 +0200
@@ -821,11 +821,13 @@ static int nl80211_set_channel(struct sk
result = get_rdev_dev_by_info_ifindex(info, &rdev, &netdev);
if (result)
- goto unlock;
+ goto unlock_rtnl;
result = __nl80211_set_channel(rdev, netdev->ieee80211_ptr, info);
- unlock:
+ dev_put(netdev);
+ cfg80211_unlock_rdev(rdev);
+ unlock_rtnl:
rtnl_unlock();
return result;
@@ -5095,7 +5097,7 @@ static int nl80211_set_cqm_rssi(struct g
err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
if (err)
- goto unlock_rdev;
+ goto unlock_rtnl;
wdev = dev->ieee80211_ptr;
@@ -5113,9 +5115,10 @@ static int nl80211_set_cqm_rssi(struct g
err = rdev->ops->set_cqm_rssi_config(wdev->wiphy, dev,
threshold, hysteresis);
-unlock_rdev:
+ unlock_rdev:
cfg80211_unlock_rdev(rdev);
dev_put(dev);
+ unlock_rtnl:
rtnl_unlock();
return err;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-09-30 20:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-30 20:17 [PATCH] cfg80211: fix locking Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).