public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2.6.32] cfg80211: fix netns error unwinding bug
@ 2009-10-08 19:02 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2009-10-08 19:02 UTC (permalink / raw)
  To: John Linville; +Cc: linux-wireless

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>
---
 net/wireless/nl80211.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- wireless-testing.orig/net/wireless/nl80211.c	2009-10-06 16:15:18.000000000 +0200
+++ wireless-testing/net/wireless/nl80211.c	2009-10-06 16:15:28.000000000 +0200
@@ -4031,7 +4031,7 @@ static int nl80211_wiphy_netns(struct sk
 	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);
@@ -4051,6 +4051,7 @@ static int nl80211_wiphy_netns(struct sk
 	put_net(net);
  out:
 	cfg80211_unlock_rdev(rdev);
+ out_rtnl:
 	rtnl_unlock();
 	return err;
 }



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-10-08 19:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-08 19:02 [PATCH 2.6.32] cfg80211: fix netns error unwinding bug Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox