1
0
Fork 0

mac80211: fix statistics leak if dev_alloc_name() fails

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.

Cc: stable@vger.kernel.org
Fixes: 5a490510ba ("mac80211: use per-CPU TX/RX statistics")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
4.6.x
Johannes Berg 2016-04-26 13:47:08 +02:00
parent 8f815cdde3
commit e6436be21e
1 changed files with 2 additions and 2 deletions

View File

@ -1761,7 +1761,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;
}
@ -1847,7 +1847,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;
}
}