Commit 9709da9d authored by Kuan-Wei Chiu's avatar Kuan-Wei Chiu Committed by Greg Kroah-Hartman
Browse files

clk: imx: scu: Fix memory leak in __imx_clk_gpr_scu()



[ Upstream commit 21c0efbc ]

In cases where imx_clk_is_resource_owned() returns false, the code path
does not handle the failure gracefully, potentially leading to a memory
leak. This fix ensures proper cleanup by freeing the allocated memory
for 'clk_node' before returning.

Signed-off-by: default avatarKuan-Wei Chiu <visitorckw@gmail.com>
Reviewed-by: default avatarPeng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/all/20231210171907.3410922-1-visitorckw@gmail.com/


Signed-off-by: default avatarAbel Vesa <abel.vesa@linaro.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 91828d93
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment