Skip to content

Commit

Permalink
wifi: mac80211: fix memory leak in ieee80211_if_add()
Browse files Browse the repository at this point in the history
When register_netdevice() failed in ieee80211_if_add(), ndev->tstats
isn't released. Fix it.

Fixes: 5a49051 ("mac80211: use per-CPU TX/RX statistics")
Signed-off-by: Zhengchao Shao <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
zhengchaoshao authored and jmberg-intel committed Dec 1, 2022
1 parent 5cc58b3 commit 13e5afd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/mac80211/iface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 13e5afd

Please sign in to comment.