public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] spl: fit: do not check argument of free()
@ 2020-04-20 10:44 Heinrich Schuchardt
  2020-04-26 11:28 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2020-04-20 10:44 UTC (permalink / raw)
  To: u-boot

The free() function checks if its argument is NULL. It is superfluous to do
the same check on the calling side.

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

diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index 69dabd27f6..c51e4beb1c 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -425,8 +425,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,
 			debug("%s: DT overlay %s applied\n", __func__,
 			      fit_get_name(fit, node, NULL));
 		}
-		if (tmpbuffer)
-			free(tmpbuffer);
+		free(tmpbuffer);
 		if (ret)
 			return ret;
 	}
--
2.25.1

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

* [PATCH 1/1] spl: fit: do not check argument of free()
  2020-04-20 10:44 [PATCH 1/1] spl: fit: do not check argument of free() Heinrich Schuchardt
@ 2020-04-26 11:28 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2020-04-26 11:28 UTC (permalink / raw)
  To: u-boot

On Mon, Apr 20, 2020 at 12:44:01PM +0200, Heinrich Schuchardt wrote:

> The free() function checks if its argument is NULL. It is superfluous to do
> the same check on the calling side.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200426/8d0aa3a3/attachment.sig>

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

end of thread, other threads:[~2020-04-26 11:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-20 10:44 [PATCH 1/1] spl: fit: do not check argument of free() Heinrich Schuchardt
2020-04-26 11:28 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox