diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-30 16:17:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-10-05 13:35:23 -0400 |
commit | 2234362c427e2ef667595b9b81c0125003ac5607 (patch) | |
tree | a3cef2721184bd61bc058b299957c0fd2119db68 /net/wireless | |
parent | b1ae1edf9e9872d3aa657cc34ae40c9aadfbc72f (diff) |
cfg80211: fix locking
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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index cbbbe9ab452f..21061ccee557 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -821,11 +821,13 @@ static int nl80211_set_channel(struct sk_buff *skb, struct genl_info *info) | |||
821 | 821 | ||
822 | result = get_rdev_dev_by_info_ifindex(info, &rdev, &netdev); | 822 | result = get_rdev_dev_by_info_ifindex(info, &rdev, &netdev); |
823 | if (result) | 823 | if (result) |
824 | goto unlock; | 824 | goto unlock_rtnl; |
825 | 825 | ||
826 | result = __nl80211_set_channel(rdev, netdev->ieee80211_ptr, info); | 826 | result = __nl80211_set_channel(rdev, netdev->ieee80211_ptr, info); |
827 | 827 | ||
828 | unlock: | 828 | dev_put(netdev); |
829 | cfg80211_unlock_rdev(rdev); | ||
830 | unlock_rtnl: | ||
829 | rtnl_unlock(); | 831 | rtnl_unlock(); |
830 | 832 | ||
831 | return result; | 833 | return result; |
@@ -5097,7 +5099,7 @@ static int nl80211_set_cqm_rssi(struct genl_info *info, | |||
5097 | 5099 | ||
5098 | err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); | 5100 | err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev); |
5099 | if (err) | 5101 | if (err) |
5100 | goto unlock_rdev; | 5102 | goto unlock_rtnl; |
5101 | 5103 | ||
5102 | wdev = dev->ieee80211_ptr; | 5104 | wdev = dev->ieee80211_ptr; |
5103 | 5105 | ||
@@ -5115,9 +5117,10 @@ static int nl80211_set_cqm_rssi(struct genl_info *info, | |||
5115 | err = rdev->ops->set_cqm_rssi_config(wdev->wiphy, dev, | 5117 | err = rdev->ops->set_cqm_rssi_config(wdev->wiphy, dev, |
5116 | threshold, hysteresis); | 5118 | threshold, hysteresis); |
5117 | 5119 | ||
5118 | unlock_rdev: | 5120 | unlock_rdev: |
5119 | cfg80211_unlock_rdev(rdev); | 5121 | cfg80211_unlock_rdev(rdev); |
5120 | dev_put(dev); | 5122 | dev_put(dev); |
5123 | unlock_rtnl: | ||
5121 | rtnl_unlock(); | 5124 | rtnl_unlock(); |
5122 | 5125 | ||
5123 | return err; | 5126 | return err; |