diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-10-08 15:02:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-10-08 16:27:00 -0400 |
commit | 8a8e05e5d8f6155788761961fc9845328863c16d (patch) | |
tree | fc842a395135d7840b440d656cf31f0a7b1548f3 /net | |
parent | 7e937c633f718e0916a294db7282c922c1bf3ce3 (diff) |
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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index eddab097435c..ca3c92a0a14f 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) | |||
4029 | rdev = cfg80211_get_dev_from_info(info); | 4029 | rdev = cfg80211_get_dev_from_info(info); |
4030 | if (IS_ERR(rdev)) { | 4030 | if (IS_ERR(rdev)) { |
4031 | err = PTR_ERR(rdev); | 4031 | err = PTR_ERR(rdev); |
4032 | goto out; | 4032 | goto out_rtnl; |
4033 | } | 4033 | } |
4034 | 4034 | ||
4035 | net = get_net_ns_by_pid(pid); | 4035 | net = get_net_ns_by_pid(pid); |
@@ -4049,6 +4049,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info) | |||
4049 | put_net(net); | 4049 | put_net(net); |
4050 | out: | 4050 | out: |
4051 | cfg80211_unlock_rdev(rdev); | 4051 | cfg80211_unlock_rdev(rdev); |
4052 | out_rtnl: | ||
4052 | rtnl_unlock(); | 4053 | rtnl_unlock(); |
4053 | return err; | 4054 | return err; |
4054 | } | 4055 | } |