diff options
author | Johannes Berg <johannes.berg@intel.com> | 2016-04-26 13:47:08 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-05-11 11:21:13 +0200 |
commit | fe9295e05bf878652e8d0e5caef53516d8de1789 (patch) | |
tree | 317743ecd69562f057d330363558bb190ff567e0 /net | |
parent | ee22885fc1fb49f98bb59e0825cc4ef3b1004f00 (diff) | |
download | lwn-fe9295e05bf878652e8d0e5caef53516d8de1789.tar.gz lwn-fe9295e05bf878652e8d0e5caef53516d8de1789.zip |
mac80211: fix statistics leak if dev_alloc_name() fails
commit e6436be21e77e3659b4ff7e357ab5a8342d132d2 upstream.
In the case that dev_alloc_name() fails, e.g. because the name was
given by the user and already exists, we need to clean up properly
and free the per-CPU statistics. Fix that.
Fixes: 5a490510ba5f ("mac80211: use per-CPU TX/RX statistics")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/mac80211/iface.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 7a2b7915093b..bcb0a1b64556 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1750,7 +1750,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ret = dev_alloc_name(ndev, ndev->name); if (ret < 0) { - free_netdev(ndev); + ieee80211_if_free(ndev); return ret; } @@ -1836,7 +1836,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, ret = register_netdevice(ndev); if (ret) { - free_netdev(ndev); + ieee80211_if_free(ndev); return ret; } } |