clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup()
Subsystems (2)
PATCH 1/1 clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup()
_ti_omap4_clkctrl_setup() misses to call kfree() in an error path. Add the missed function call to fix it.
--- drivers/clk/ti/clkctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/ti/clkctrl.c +3 -1
@@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) } hw =kzalloc (sizeof (*hw),GFP_KERNEL ); -if (!hw) +if (!hw) { +kfree (clkctrl_name);return ; + } hw->enable_reg.ptr = provider->base + reg_data->offset;
Signature · 1 line
2.17.1
Stephen Boyd
maintainerQuoting Jing Xiangfeng (2020-07-20 05:23:43)
Quoted 14 lines
_ti_omap4_clkctrl_setup()misses to callkfree()in an error path. Add the missed function call to fix it.Fixes 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node name")Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/clk/ti/clkctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/clk/ti/clkctrl.c +0
-0
drivers/clk/ti/clkctrl.c static void __init _ti_omap4_clkctrl_setup(struct device_node *node) · line 661
Quoted 8 lines
drivers/clk/ti/clkctrl.c +3
-1@@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) } hw =kzalloc (sizeof (*hw),GFP_KERNEL ); -if (!hw) +if (!hw) { +kfree (clkctrl_name);return ; + }
Why not goto cleanup?
Quoted 6 lines
drivers/clk/ti/clkctrl.c +0
-0hw->enable_reg.ptr = provider->base + reg_data->offset;Signature · 1 line
2.17.1
Quoted 17 lines · Stephen Boyd
Quoting Jing Xiangfeng (2020-07-20 05:23:43)
Quoted 16 lines
_ti_omap4_clkctrl_setup()misses to callkfree()in an error path. Add the missed function call to fix it.Fixes 6c3090520554 ("clk: ti: clkctrl: Fix hidden dependency to node name")Signed-off-by Jing Xiangfeng <[email protected]>--- drivers/clk/ti/clkctrl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/clk/ti/clkctrl.c +0
-0@@ -655,8 +655,10 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node) }
Quoted 8 lines
drivers/clk/ti/clkctrl.c static void __init _ti_omap4_clkctrl_setup(struct device_node *node) · line 661
Quoted 6 lines
drivers/clk/ti/clkctrl.c +3
-1hw =kzalloc (sizeof (*hw),GFP_KERNEL ); -if (!hw) +if (!hw) { +kfree (clkctrl_name);return ; + }Why not goto cleanup?
Thanks, I will change it as you suggested.
Quoted 9 lines
Quoted 7 lines
drivers/clk/ti/clkctrl.c +0
-1hw->enable_reg.ptr = provider->base + reg_data->offset; --2.17.1
.