Skip to content
Commit 2759f38b authored by Xiaoke Wang's avatar Xiaoke Wang Committed by Abel Vesa
Browse files

clk: imx: scu: fix a potential memory leak in __imx_clk_gpr_scu()



In __imx_clk_gpr_scu(), if imx_scu_clk_is_valid(rsrc_id) fails, then
`clk_node` which is allocated by kzalloc() is not properly released,
which may lead to memory leak.
So this patch added kfree(clk_node) on the above error path before
return ERR_PTR(-EINVAL).

Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
Reviewed-by: default avatarAbel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/tencent_27FF59903EE6AB5C0D0E6D0A8E7059A59007@qq.com
Signed-off-by: default avatarAbel Vesa <abel.vesa@nxp.com>
parent ed713e2b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment