Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2234362c authored by Johannes Berg's avatar Johannes Berg Committed by John W. Linville
Browse files

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: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent b1ae1edf
Loading
Loading
Loading
Loading
+7 −4
Original line number Original line Diff line number Diff line
@@ -821,11 +821,13 @@ static int nl80211_set_channel(struct sk_buff *skb, struct genl_info *info)


	result = get_rdev_dev_by_info_ifindex(info, &rdev, &netdev);
	result = get_rdev_dev_by_info_ifindex(info, &rdev, &netdev);
	if (result)
	if (result)
		goto unlock;
		goto unlock_rtnl;


	result = __nl80211_set_channel(rdev, netdev->ieee80211_ptr, info);
	result = __nl80211_set_channel(rdev, netdev->ieee80211_ptr, info);


 unlock:
	dev_put(netdev);
	cfg80211_unlock_rdev(rdev);
 unlock_rtnl:
	rtnl_unlock();
	rtnl_unlock();


	return result;
	return result;
@@ -5097,7 +5099,7 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,


	err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
	err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
	if (err)
	if (err)
		goto unlock_rdev;
		goto unlock_rtnl;


	wdev = dev->ieee80211_ptr;
	wdev = dev->ieee80211_ptr;


@@ -5118,6 +5120,7 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
 unlock_rdev:
 unlock_rdev:
	cfg80211_unlock_rdev(rdev);
	cfg80211_unlock_rdev(rdev);
	dev_put(dev);
	dev_put(dev);
 unlock_rtnl:
	rtnl_unlock();
	rtnl_unlock();


	return err;
	return err;