diff options
author | Heinrich Schuchardt | 2022-04-11 20:08:03 +0200 |
---|---|---|
committer | Tom Rini | 2022-04-19 14:51:11 -0400 |
commit | 7ffc66e7dbdd2c82b6b544574d39af6412a16b6e (patch) | |
tree | 77802b38de4520fba68831eaab97d33938330d0e | |
parent | fe2f284270718c6cfbe7f87e7e1f378c2b172bf5 (diff) |
image-fit: don't check free() argument
* free() checks if its argument is NULL. Remove duplicate checks.
* Remove duplicate free(ovcopy).
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r-- | boot/image-fit.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/boot/image-fit.c b/boot/image-fit.c index 6610035d0ad..f57d97f5522 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -1887,8 +1887,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; } @@ -2422,9 +2421,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"); @@ -2442,11 +2438,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 |