diff options
author | Zhengchao Shao <shaozhengchao@huawei.com> | 2022-11-17 07:45:00 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2022-12-01 13:50:41 +0100 |
commit | 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293 (patch) | |
tree | 76b5804c5cfe75a26e4428de7b07dd19c35874dd /net/mac80211 | |
parent | wifi: nl80211: Add checks for nla_nest_start() in nl80211_send_iface() (diff) | |
download | linux-13e5afd3d773c6fc6ca2b89027befaaaa1ea7293.tar.xz linux-13e5afd3d773c6fc6ca2b89027befaaaa1ea7293.zip |
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/mac80211')
-rw-r--r-- | net/mac80211/iface.c | 1 |
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; } |