Skip to contentSkip to conversation

spl: fit: do not check argument of free()

PATCH New Heinrich Schuchardt 2 participants 2 messages Apr 20, 2020 – Apr 26, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spl: fit: do not check argument of free()

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

---
 common/spl/spl_fit.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
common/spl/spl_fit.c +1 -2
index 69dabd27f6..c51e4beb1c 100644
@@ -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

#1 lore raw

PATCH 1/1 spl: fit: do not check argument of free()

Quoted 4 lines · Heinrich Schuchardt

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

Applied to u-boot/master, thanks!

Signature · 8 lines
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>