lkml.org 
[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clk: ti: clkctrl: add the missed kfree() for _ti_omap4_clkctrl_setup()
From
Date

> +++ b/drivers/clk/ti/clkctrl.c
> @@ -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;
> + }


I suggest to use an additional label instead.

if (!hw)
- return;
+ goto free_control_name;


By the way:
How do you think about to replace the label “cleanup” by other jump targets
for better exception handling in this function implementation?

Regards,
Markus

\
 
 \ /
  Last update: 2020-07-20 16:19    [W:0.036 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site