Patch "clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return" has been added to the 5.10-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

    clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return

to the 5.10-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:
     clk-socfpga-arria10-fix-memory-leak-of-socfpga_clk-o.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 5d75c48f564f0d183d859f2442aa2ad1c5231a8c
Author: Colin Ian King <colin.king@xxxxxxxxxxxxx>
Date:   Tue Apr 6 18:01:15 2021 +0100

    clk: socfpga: arria10: Fix memory leak of socfpga_clk on error return
    
    [ Upstream commit 657d4d1934f75a2d978c3cf2086495eaa542e7a9 ]
    
    There is an error return path that is not kfree'ing socfpga_clk leading
    to a memory leak. Fix this by adding in the missing kfree call.
    
    Addresses-Coverity: ("Resource leak")
    Signed-off-by: Colin Ian King <colin.king@xxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210406170115.430990-1-colin.king@xxxxxxxxxxxxx
    Acked-by: Dinh Nguyen <dinguyen@xxxxxxxxxx>
    Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/socfpga/clk-gate-a10.c b/drivers/clk/socfpga/clk-gate-a10.c
index cd5df9103614..d62778884208 100644
--- a/drivers/clk/socfpga/clk-gate-a10.c
+++ b/drivers/clk/socfpga/clk-gate-a10.c
@@ -146,6 +146,7 @@ static void __init __socfpga_gate_init(struct device_node *node,
 		if (IS_ERR(socfpga_clk->sys_mgr_base_addr)) {
 			pr_err("%s: failed to find altr,sys-mgr regmap!\n",
 					__func__);
+			kfree(socfpga_clk);
 			return;
 		}
 	}



[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