]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
cfg80211: fix locking
authorJohannes Berg <johannes.berg@intel.com>
Thu, 30 Sep 2010 20:17:43 +0000 (22:17 +0200)
committerAndi Kleen <ak@linux.intel.com>
Tue, 14 Dec 2010 22:40:00 +0000 (23:40 +0100)
commit 2234362c427e2ef667595b9b81c0125003ac5607 upstream.

Add missing unlocking of the wiphy in set_channel,
and don't try to unlock a non-existing wiphy in
set_cqm.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/wireless/nl80211.c

index db71150b8040d07d9590a8229b9070b7461d7279..da657d8231140fbad9cb3f0058d2794fb4bdf5d4 100644 (file)
@@ -758,11 +758,13 @@ static int nl80211_set_channel(struct sk_buff *skb, struct genl_info *info)
 
        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;
@@ -4909,7 +4911,7 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
 
        err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
        if (err)
-               goto unlock_rdev;
+               goto unlock_rtnl;
 
        wdev = dev->ieee80211_ptr;
 
@@ -4926,9 +4928,10 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
        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;