mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
wifi: mac80211: fix memory leak in ieee80211_if_add()
[ Upstream commit13e5afd3d7] When register_netdevice() failed in ieee80211_if_add(), ndev->tstats isn't released. Fix it. Fixes:5a490510ba("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
687b6b37c0
commit
9a50a7f642
|
|
@ -2258,6 +2258,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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user