mac80211: free netdev on dev_alloc_name() error
authorJohannes Berg <johannes.berg@intel.com>
Fri, 9 Jun 2017 19:33:09 +0000 (21:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 Jun 2017 19:40:15 +0000 (15:40 -0400)
The change to remove free_netdev() from ieee80211_if_free()
erroneously didn't add the necessary free_netdev() for when
ieee80211_if_free() is called directly in one place, rather
than as the priv_destructor. Add the missing call.

Fixes: cf124db566e6 ("net: Fix inconsistent teardown and release of private netdev state.")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mac80211/iface.c

index 915d7e1b45455b1de2b895c063f0c08c760721fc..f5f50150ba1cd7f53689a4e5efac3235f04679cf 100644 (file)
@@ -1816,6 +1816,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
                ret = dev_alloc_name(ndev, ndev->name);
                if (ret < 0) {
                        ieee80211_if_free(ndev);
+                       free_netdev(ndev);
                        return ret;
                }