Skip to content

Commit 054ef44

Browse files
Jian Dongabelvesa
authored andcommitted
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 <[email protected]> Signed-off-by: Abel Vesa <[email protected]>
1 parent 8304b15 commit 054ef44

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

drivers/clk/imx/clk-lpcg-scu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ struct clk_hw *__imx_clk_lpcg_scu(struct device *dev, const char *name,
114114
if (ret) {
115115
kfree(clk);
116116
hw = ERR_PTR(ret);
117+
return hw;
117118
}
118119

119120
if (dev)

drivers/clk/imx/clk-scu.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ struct clk_hw *__imx_clk_scu(struct device *dev, const char *name,
426426
if (ret) {
427427
kfree(clk);
428428
hw = ERR_PTR(ret);
429+
return hw;
429430
}
430431

431432
if (dev)

0 commit comments

Comments
 (0)