Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: Reference preceded by free

When register failed, clk will be freed, it will generate dangling pointer
problem in later reference. it should return directly.

Signed-off-by: Jian Dong <dongjian@yulong.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

authored by

Jian Dong and committed by
Abel Vesa
054ef44e 8304b15e

+2
+1
drivers/clk/imx/clk-lpcg-scu.c
··· 114 114 if (ret) { 115 115 kfree(clk); 116 116 hw = ERR_PTR(ret); 117 + return hw; 117 118 } 118 119 119 120 if (dev)
+1
drivers/clk/imx/clk-scu.c
··· 426 426 if (ret) { 427 427 kfree(clk); 428 428 hw = ERR_PTR(ret); 429 + return hw; 429 430 } 430 431 431 432 if (dev)