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>
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;
err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
if (err)
- goto unlock_rdev;
+ goto unlock_rtnl;
wdev = dev->ieee80211_ptr;
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;