When the passed `blob` is not a valid FDT, the memory allocated for `tree` should be freed. Move the allocation after the fdt_is_valid() check to avoid the problem. Also remove the unnecessary cast to 'const struct fdt_header *'. Change-Id: If591172cd511ae2a1ca9c26f2addef8d67fd0b69 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/88948 Reviewed-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com> Reviewed-by: Paul Menzel <paulepanter@mailbox.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com> |
||
|---|---|---|
| .. | ||
| bsd | ||
| include/commonlib | ||
| storage | ||
| device_tree.c | ||
| fsp_relocate.c | ||
| iobuf.c | ||
| list.c | ||
| Makefile.mk | ||
| mem_pool.c | ||
| rational.c | ||
| region.c | ||
| sort.c | ||