From: Johannes Berg Date: Fri, 9 Jun 2017 19:33:09 +0000 (+0200) Subject: mac80211: free netdev on dev_alloc_name() error X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c7a61cba71fd151cc7d9ebe53a090e0e61eeebf3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mac80211: free netdev on dev_alloc_name() error 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 Signed-off-by: David S. Miller --- diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 915d7e1b4545..f5f50150ba1c 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -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; }