All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] clk: kendryte: no need to check argument of free()
@ 2020-09-29 19:52 Heinrich Schuchardt
  2020-09-29 20:06 ` Sean Anderson
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2020-09-29 19:52 UTC (permalink / raw)
  To: u-boot

free() checks if its argument is NULL. No need to check it twice.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/clk/kendryte/clk.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/clk/kendryte/clk.c b/drivers/clk/kendryte/clk.c
index 981b3b7699..26139fd804 100644
--- a/drivers/clk/kendryte/clk.c
+++ b/drivers/clk/kendryte/clk.c
@@ -471,8 +471,7 @@ cleanup_gate:
 cleanup_div:
 	free(div);
 cleanup_mux:
-	if (mux)
-		free(mux);
+	free(mux);
 	return comp;
 }

--
2.28.0

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

* [PATCH 1/1] clk: kendryte: no need to check argument of free()
  2020-09-29 19:52 [PATCH 1/1] clk: kendryte: no need to check argument of free() Heinrich Schuchardt
@ 2020-09-29 20:06 ` Sean Anderson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Anderson @ 2020-09-29 20:06 UTC (permalink / raw)
  To: u-boot

On 9/29/20 3:52 PM, Heinrich Schuchardt wrote:
> free() checks if its argument is NULL. No need to check it twice.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/clk/kendryte/clk.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/kendryte/clk.c b/drivers/clk/kendryte/clk.c
> index 981b3b7699..26139fd804 100644
> --- a/drivers/clk/kendryte/clk.c
> +++ b/drivers/clk/kendryte/clk.c
> @@ -471,8 +471,7 @@ cleanup_gate:
>  cleanup_div:
>  	free(div);
>  cleanup_mux:
> -	if (mux)
> -		free(mux);
> +	free(mux);
>  	return comp;
>  }
> 
> --
> 2.28.0
> 

LGTM

Reviewed-by: Sean Anderson <seanga2@gmail.com>

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

end of thread, other threads:[~2020-09-29 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-29 19:52 [PATCH 1/1] clk: kendryte: no need to check argument of free() Heinrich Schuchardt
2020-09-29 20:06 ` Sean Anderson

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.