Skip to contentSkip to conversation

nl80211: fix error in generic netif_running check

PATCH New Johannes Berg 1 participant 1 message Oct 5, 2010 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 nl80211: fix error in generic netif_running check

From: Johannes Berg <[email protected]>

Yikes! The error return keeps a netdev reference
and the rdev mutex locked, fix that!

---
 net/wireless/nl80211.c |    2 ++
 1 file changed, 2 insertions(+)
net/wireless/nl80211.c +2 -0
@@ -4330,6 +4330,8 @@ static int nl80211_pre_doit(struct genl_
 		}
 		if (ops->internal_flags & NL80211_FLAG_CHECK_NETDEV_UP &&
 		    !netif_running(dev)) {
+			cfg80211_unlock_rdev(rdev);
+			dev_put(dev);
 			if (rtnl)
 				rtnl_unlock();
 			return -ENETDOWN;