diff mbox series

[-next] ti/fapll: Delete useless kfree code

Message ID 20201216130534.13925-1-zhengyongjun3@huawei.com
State New
Headers show
Series [-next] ti/fapll: Delete useless kfree code | expand

Commit Message

Zheng Yongjun Dec. 16, 2020, 1:05 p.m. UTC
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(-)

Comments

Stephen Boyd Dec. 17, 2020, 9:49 a.m. UTC | #1
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);
diff mbox series

Patch

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);