mac80211: fix statistics leak if dev_alloc_name() fails
authorJohannes Berg <johannes.berg@intel.com>
Tue, 26 Apr 2016 11:47:08 +0000 (13:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 11 May 2016 09:21:13 +0000 (11:21 +0200)
commitfe9295e05bf878652e8d0e5caef53516d8de1789
tree317743ecd69562f057d330363558bb190ff567e0
parentee22885fc1fb49f98bb59e0825cc4ef3b1004f00
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>
net/mac80211/iface.c