提交 8a8e05e5 编写于 作者: J Johannes Berg 提交者: John W. Linville

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: NJohannes Berg <johannes@sipsolutions.net>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 7e937c63
...@@ -4029,7 +4029,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info) ...@@ -4029,7 +4029,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info)
rdev = cfg80211_get_dev_from_info(info); rdev = cfg80211_get_dev_from_info(info);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
err = PTR_ERR(rdev); err = PTR_ERR(rdev);
goto out; goto out_rtnl;
} }
net = get_net_ns_by_pid(pid); 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,6 +4049,7 @@ static int nl80211_wiphy_netns(struct sk_buff *skb, struct genl_info *info)
put_net(net); put_net(net);
out: out:
cfg80211_unlock_rdev(rdev); cfg80211_unlock_rdev(rdev);
out_rtnl:
rtnl_unlock(); rtnl_unlock();
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册