lib/device_tree.c: Fix wrong check for FDT validity
Obviously one should return NULL if a FDT is not valid an not the other way around. Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com> Change-Id: I77c0e187b841e60965daac17025110181bdd32bc Reviewed-on: https://review.coreboot.org/c/coreboot/+/82773 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
This commit is contained in:
@@ -608,7 +608,7 @@ struct device_tree *fdt_unflatten(const void *blob)
|
||||
const struct fdt_header *header = (const struct fdt_header *)blob;
|
||||
tree->header = header;
|
||||
|
||||
if (fdt_is_valid(blob))
|
||||
if (!fdt_is_valid(blob))
|
||||
return NULL;
|
||||
|
||||
uint32_t struct_offset = be32toh(header->structure_offset);
|
||||
|
Reference in New Issue
Block a user