All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] ti/fapll: Delete useless kfree code
@ 2020-12-16 13:05 Zheng Yongjun
  2020-12-17  9:49 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Zheng Yongjun @ 2020-12-16 13:05 UTC (permalink / raw)
  To: t-kristo, mturquette, sboyd, linux-omap, linux-clk, linux-kernel
  Cc: Zheng Yongjun

The parameter of kfree function is NULL, so kfree code is useless, delete it.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
---
 drivers/clk/ti/fapll.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
index 95e36ba64acc..a61d69159e9a 100644
--- a/drivers/clk/ti/fapll.c
+++ b/drivers/clk/ti/fapll.c
@@ -523,7 +523,6 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,
 	return clk_register(NULL, &synth->hw);
 
 free:
-	kfree(synth);
 	kfree(init);
 
 	return ERR_PTR(-ENOMEM);
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] ti/fapll: Delete useless kfree code
  2020-12-16 13:05 [PATCH -next] ti/fapll: Delete useless kfree code Zheng Yongjun
@ 2020-12-17  9:49 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2020-12-17  9:49 UTC (permalink / raw)
  To: Zheng Yongjun, linux-clk, linux-kernel, linux-omap, mturquette, t-kristo
  Cc: Zheng Yongjun

Quoting Zheng Yongjun (2020-12-16 05:05:34)
> The parameter of kfree function is NULL, so kfree code is useless, delete it.

Not always though. Sometimes it is non-NULL and this code avoids a goto.

> 
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> ---
>  drivers/clk/ti/fapll.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
> index 95e36ba64acc..a61d69159e9a 100644
> --- a/drivers/clk/ti/fapll.c
> +++ b/drivers/clk/ti/fapll.c
> @@ -523,7 +523,6 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd,
>         return clk_register(NULL, &synth->hw);
>  
>  free:
> -       kfree(synth);
>         kfree(init);
>  
>         return ERR_PTR(-ENOMEM);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-17  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16 13:05 [PATCH -next] ti/fapll: Delete useless kfree code Zheng Yongjun
2020-12-17  9:49 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.