Patch "wifi: mac80211: fix memory leak in ieee80211_if_add()" has been added to the 4.19-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mac80211: fix memory leak in ieee80211_if_add()

to the 4.19-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mac80211-fix-memory-leak-in-ieee80211_if_add.patch
and it can be found in the queue-4.19 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 27e908352316cb12a174037ca597285139867b00
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Thu Nov 17 14:45:00 2022 +0800

    wifi: mac80211: fix memory leak in ieee80211_if_add()
    
    [ Upstream commit 13e5afd3d773c6fc6ca2b89027befaaaa1ea7293 ]
    
    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@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221117064500.319983-1-shaozhengchao@xxxxxxxxxx
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 358028a09ce4..5d252d144cb9 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -1888,6 +1888,7 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name,
 
 		ret = register_netdevice(ndev);
 		if (ret) {
+			ieee80211_if_free(ndev);
 			free_netdev(ndev);
 			return ret;
 		}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux