Patch "wifi: ipw2200: fix memory leak in ipw_wdev_init()" has been added to the 6.1-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: ipw2200: fix memory leak in ipw_wdev_init()

to the 6.1-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-ipw2200-fix-memory-leak-in-ipw_wdev_init.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 5a0e02b019cda9889c5430897517be9848b83dab
Author: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
Date:   Fri Dec 9 09:24:22 2022 +0800

    wifi: ipw2200: fix memory leak in ipw_wdev_init()
    
    [ Upstream commit 9fe21dc626117fb44a8eb393713a86a620128ce3 ]
    
    In the error path of ipw_wdev_init(), exception value is returned, and
    the memory applied for in the function is not released. Also the memory
    is not released in ipw_pci_probe(). As a result, memory leakage occurs.
    So memory release needs to be added to the error path of ipw_wdev_init().
    
    Fixes: a3caa99e6c68 ("libipw: initiate cfg80211 API conversion (v2)")
    Signed-off-by: Zhengchao Shao <shaozhengchao@xxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221209012422.182669-1-shaozhengchao@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index 1d088f9b1b443..9dfa34a740dc9 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -11397,9 +11397,14 @@ static int ipw_wdev_init(struct net_device *dev)
 	set_wiphy_dev(wdev->wiphy, &priv->pci_dev->dev);
 
 	/* With that information in place, we can now register the wiphy... */
-	if (wiphy_register(wdev->wiphy))
-		rc = -EIO;
+	rc = wiphy_register(wdev->wiphy);
+	if (rc)
+		goto out;
+
+	return 0;
 out:
+	kfree(priv->ieee->a_band.channels);
+	kfree(priv->ieee->bg_band.channels);
 	return rc;
 }
 



[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