Patch "clk: tegra: tegra124-emc: Fix potential memory leak" 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: tegra: tegra124-emc: Fix potential memory leak

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-tegra-tegra124-emc-fix-potential-memory-leak.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 d127b02234e27efcf36a6d05e056fa2cb1105221
Author: Yuan Can <yuancan@xxxxxxxxxx>
Date:   Fri Dec 9 09:41:24 2022 +0000

    clk: tegra: tegra124-emc: Fix potential memory leak
    
    [ Upstream commit 53a06e5924c0d43c11379a08c5a78529c3e61595 ]
    
    The tegra and tegra needs to be freed in the error handling path, otherwise
    it will be leaked.
    
    Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver")
    Signed-off-by: Yuan Can <yuancan@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221209094124.71043-1-yuancan@xxxxxxxxxx
    Acked-by: Thierry Reding <treding@xxxxxxxxxx>
    Signed-off-by: Stephen Boyd <sboyd@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
index 733a962ff521a..15f728edc54b5 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -455,6 +455,7 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra,
 		err = load_one_timing_from_dt(tegra, timing, child);
 		if (err) {
 			of_node_put(child);
+			kfree(tegra->timings);
 			return err;
 		}
 
@@ -506,6 +507,7 @@ struct clk *tegra_clk_register_emc(void __iomem *base, struct device_node *np,
 		err = load_timings_from_dt(tegra, node, node_ram_code);
 		if (err) {
 			of_node_put(node);
+			kfree(tegra);
 			return ERR_PTR(err);
 		}
 	}



[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