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>
This commit is contained in:
Heinrich Schuchardt 2022-04-11 20:08:03 +02:00 committed by Tom Rini
parent fe2f284270
commit 7ffc66e7db

View File

@ -1887,7 +1887,6 @@ int fit_conf_get_node(const void *fit, const char *conf_uname)
conf_uname, fdt_strerror(noffset)); conf_uname, fdt_strerror(noffset));
} }
if (conf_uname_copy)
free(conf_uname_copy); free(conf_uname_copy);
return noffset; return noffset;
@ -2422,9 +2421,6 @@ int boot_get_fdt_fit(bootm_headers_t *images, ulong addr,
} }
fdt_pack(base); fdt_pack(base);
len = fdt_totalsize(base); len = fdt_totalsize(base);
free(ovcopy);
ovcopy = NULL;
} }
#else #else
printf("config with overlays but CONFIG_OF_LIBFDT_OVERLAY not set\n"); printf("config with overlays but CONFIG_OF_LIBFDT_OVERLAY not set\n");
@ -2442,10 +2438,8 @@ out:
*fit_uname_configp = fit_uname_config; *fit_uname_configp = fit_uname_config;
#ifdef CONFIG_OF_LIBFDT_OVERLAY #ifdef CONFIG_OF_LIBFDT_OVERLAY
if (ovcopy)
free(ovcopy); free(ovcopy);
#endif #endif
if (fit_uname_config_copy)
free(fit_uname_config_copy); free(fit_uname_config_copy);
return fdt_noffset; return fdt_noffset;
} }