2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 02:34:01 +08:00

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>
This commit is contained in:
Jian Dong 2021-03-23 11:10:34 +08:00 committed by Abel Vesa
parent 8304b15e13
commit 054ef44ea3
2 changed files with 2 additions and 0 deletions

View File

@ -114,6 +114,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name,
if (ret) {
kfree(clk);
hw = ERR_PTR(ret);
return hw;
}
if (dev)

View File

@ -426,6 +426,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
if (ret) {
kfree(clk);
hw = ERR_PTR(ret);
return hw;
}
if (dev)