summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorZhengchao Shao <shaozhengchao@huawei.com>2022-11-17 14:45:00 +0800
committerJohannes Berg <johannes.berg@intel.com>2022-12-01 13:50:41 +0100
commit13e5afd3d773c6fc6ca2b89027befaaaa1ea7293 (patch)
tree76b5804c5cfe75a26e4428de7b07dd19c35874dd /net
parent5cc58b376675981386c6192405fe887cd29c527a (diff)
wifi: mac80211: fix memory leak in ieee80211_if_add()
When register_netdevice() failed in ieee80211_if_add(), ndev->tstats isn't released. Fix it. Fixes: 5a490510ba5f ("mac80211: use per-CPU TX/RX statistics") Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com> Link: https://lore.kernel.org/r/20221117064500.319983-1-shaozhengchao@huawei.com Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net')
-rw-r--r--net/mac80211/iface.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 7c4ce716c939..a5782927a93b 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -2195,6 +2195,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
ret = cfg80211_register_netdevice(ndev);
if (ret) {
+ ieee80211_if_free(ndev);
free_netdev(ndev);
return ret;
}