nl80211: fix error in generic netif_running check
Yikes! The error return keeps a netdev reference
and the rdev mutex locked, fix that!
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 8826888..9942f0b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4418,6 +4418,8 @@
}
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;