* [PATCH 1/1] image-fit: don't check free() argument
@ 2022-04-11 18:08 Heinrich Schuchardt
2022-04-20 13:12 ` Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2022-04-11 18:08 UTC (permalink / raw)
To: Tom Rini
Cc: Simon Glass, Alexandru Gagniuc, Chia-Wei Wang, u-boot,
Heinrich Schuchardt
* free() checks if its argument is NULL. Remove duplicate checks.
* Remove duplicate free(ovcopy).
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
boot/image-fit.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/boot/image-fit.c b/boot/image-fit.c
index f01cafe4e2..401cdd3b55 100644
--- a/boot/image-fit.c
+++ b/boot/image-fit.c
@@ -1885,8 +1885,7 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
conf_uname, fdt_strerror(noffset));
}
- if (conf_uname_copy)
- free(conf_uname_copy);
+ free(conf_uname_copy);
return noffset;
}
@@ -2420,9 +2419,6 @@ int boot_get_fdt_fit(bootm_headers_t *images, ulong addr,
}
fdt_pack(base);
len = fdt_totalsize(base);
-
- free(ovcopy);
- ovcopy = NULL;
}
#else
printf("config with overlays but CONFIG_OF_LIBFDT_OVERLAY not set\n");
@@ -2440,11 +2436,9 @@ out:
*fit_uname_configp = fit_uname_config;
#ifdef CONFIG_OF_LIBFDT_OVERLAY
- if (ovcopy)
- free(ovcopy);
+ free(ovcopy);
#endif
- if (fit_uname_config_copy)
- free(fit_uname_config_copy);
+ free(fit_uname_config_copy);
return fdt_noffset;
}
#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 1/1] image-fit: don't check free() argument
2022-04-11 18:08 [PATCH 1/1] image-fit: don't check free() argument Heinrich Schuchardt
@ 2022-04-20 13:12 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-04-20 13:12 UTC (permalink / raw)
To: Heinrich Schuchardt; +Cc: Simon Glass, Alexandru Gagniuc, Chia-Wei Wang, u-boot
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
On Mon, Apr 11, 2022 at 08:08:03PM +0200, Heinrich Schuchardt wrote:
> * free() checks if its argument is NULL. Remove duplicate checks.
> * Remove duplicate free(ovcopy).
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Applied to u-boot/master, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-04-20 13:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-11 18:08 [PATCH 1/1] image-fit: don't check free() argument Heinrich Schuchardt
2022-04-20 13:12 ` Tom Rini
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.