Patch "brcmsmac: fix memory leak in wlc_phy_attach_lcnphy" has been added to the 4.4-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

    brcmsmac: fix memory leak in wlc_phy_attach_lcnphy

to the 4.4-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:
     brcmsmac-fix-memory-leak-in-wlc_phy_attach_lcnphy.patch
and it can be found in the queue-4.4 subdirectory.

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



commit 52f1105aefdcf00081678d564b5766f560689ddf
Author: Keita Suzuki <keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx>
Date:   Tue Sep 8 12:17:41 2020 +0000

    brcmsmac: fix memory leak in wlc_phy_attach_lcnphy
    
    [ Upstream commit f4443293d741d1776b86ed1dd8c4e4285d0775fc ]
    
    When wlc_phy_txpwr_srom_read_lcnphy fails in wlc_phy_attach_lcnphy,
    the allocated pi->u.pi_lcnphy is leaked, since struct brcms_phy will be
    freed in the caller function.
    
    Fix this by calling wlc_phy_detach_lcnphy in the error handler of
    wlc_phy_txpwr_srom_read_lcnphy before returning.
    
    Signed-off-by: Keita Suzuki <keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Kalle Valo <kvalo@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200908121743.23108-1-keitasuzuki.park@xxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
index 93d4cde0eb313..c9f48ec46f4a1 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -5090,8 +5090,10 @@ bool wlc_phy_attach_lcnphy(struct brcms_phy *pi)
 	pi->pi_fptr.radioloftget = wlc_lcnphy_get_radio_loft;
 	pi->pi_fptr.detach = wlc_phy_detach_lcnphy;
 
-	if (!wlc_phy_txpwr_srom_read_lcnphy(pi))
+	if (!wlc_phy_txpwr_srom_read_lcnphy(pi)) {
+		kfree(pi->u.pi_lcnphy);
 		return false;
+	}
 
 	if (LCNREV_IS(pi->pubpi.phy_rev, 1)) {
 		if (pi_lcn->lcnphy_tempsense_option == 3) {



[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