Commit 054ef44e authored by Jian Dong's avatar Jian Dong Committed by Abel Vesa

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: default avatarJian Dong <dongjian@yulong.com>
Signed-off-by: default avatarAbel Vesa <abel.vesa@nxp.com>
parent 8304b15e
...@@ -114,6 +114,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name, ...@@ -114,6 +114,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name,
if (ret) { if (ret) {
kfree(clk); kfree(clk);
hw = ERR_PTR(ret); hw = ERR_PTR(ret);
return hw;
} }
if (dev) if (dev)
......
...@@ -426,6 +426,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name, ...@@ -426,6 +426,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
if (ret) { if (ret) {
kfree(clk); kfree(clk);
hw = ERR_PTR(ret); hw = ERR_PTR(ret);
return hw;
} }
if (dev) if (dev)
......
Markdown is supported
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