summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-10-08 21:02:02 +0200
committerJohn W. Linville <linville@tuxdriver.com>2009-10-08 16:27:00 -0400
commit8a8e05e5d8f6155788761961fc9845328863c16d (patch)
treefc842a395135d7840b440d656cf31f0a7b1548f3 /net
parent7e937c633f718e0916a294db7282c922c1bf3ce3 (diff)
downloadop-kernel-dev-8a8e05e5d8f6155788761961fc9845328863c16d.zip
op-kernel-dev-8a8e05e5d8f6155788761961fc9845328863c16d.tar.gz
cfg80211: fix netns error unwinding bug
The error unwinding code in set_netns has a bug that will make it run into a BUG_ON if passed a bad wiphy index, fix by not trying to unlock a wiphy that doesn't exist. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net')
-rw-r--r--net/wireless/nl80211.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index eddab09..ca3c92a 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4029,7 +4029,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info)
rdev = cfg80211_get_dev_from_info(info);
if (IS_ERR(rdev)) {
err = PTR_ERR(rdev);
- goto out;
+ goto out_rtnl;
}
net = get_net_ns_by_pid(pid);
@@ -4049,6 +4049,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info)
put_net(net);
out:
cfg80211_unlock_rdev(rdev);
+ out_rtnl:
rtnl_unlock();
return err;
}
OpenPOWER on IntegriCloud