Patch "soc: bcm: brcmstb: biuctrl: fix of_iomap leak" has been added to the 6.2-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

    soc: bcm: brcmstb: biuctrl: fix of_iomap leak

to the 6.2-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:
     soc-bcm-brcmstb-biuctrl-fix-of_iomap-leak.patch
and it can be found in the queue-6.2 subdirectory.

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



commit cf7cb0e2f7e2526e167c646549ede58453015aca
Author: Zhaoyang Li <lizhaoyang04@xxxxxxxxxxx>
Date:   Mon Mar 27 19:54:22 2023 +0800

    soc: bcm: brcmstb: biuctrl: fix of_iomap leak
    
    [ Upstream commit c3fbced9af885a6f217fd95509a613d6590916ce ]
    
    Smatch reports:
    
    drivers/soc/bcm/brcmstb/biuctrl.c:291 setup_hifcpubiuctrl_regs() warn:
    'cpubiuctrl_base' from of_iomap() not released on lines: 291.
    
    This is because in setup_hifcpubiuctrl_regs(),
    cpubiuctrl_base is not released when handle error, which may cause a leak.
    To fix this, iounmap is added when handle error.
    
    Fixes: 22f7a9116eba ("soc: brcmstb: Correct CPU_CREDIT_REG offset for Brahma-B53 CPUs")
    Signed-off-by: Zhaoyang Li <lizhaoyang04@xxxxxxxxxxx>
    Reviewed-by: Dan Carpenter <error27@xxxxxxxxx>
    Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230327115422.1536615-1-lizhaoyang04@xxxxxxxxxxx
    Signed-off-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/soc/bcm/brcmstb/biuctrl.c b/drivers/soc/bcm/brcmstb/biuctrl.c
index e1d7b45432485..364ddbe365c24 100644
--- a/drivers/soc/bcm/brcmstb/biuctrl.c
+++ b/drivers/soc/bcm/brcmstb/biuctrl.c
@@ -288,6 +288,10 @@ static int __init setup_hifcpubiuctrl_regs(struct device_node *np)
 	if (BRCM_ID(family_id) == 0x7260 && BRCM_REV(family_id) == 0)
 		cpubiuctrl_regs = b53_cpubiuctrl_no_wb_regs;
 out:
+	if (ret && cpubiuctrl_base) {
+		iounmap(cpubiuctrl_base);
+		cpubiuctrl_base = NULL;
+	}
 	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