diff options
author | Maximilian Brune <maximilian.brune@9elements.com> | 2024-06-03 05:24:32 +0200 |
---|---|---|
committer | Maximilian Brune <maximilian.brune@9elements.com> | 2024-06-03 11:17:30 +0000 |
commit | 6466354ee97e630af5b66e6bfc1efc4b9fe42243 (patch) | |
tree | 0c0189f1386372a7474a12f56833504916272b40 /src/lib/device_tree.c | |
parent | f38c9407549b70bf813248c1958d3892361a7323 (diff) |
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>
Diffstat (limited to 'src/lib/device_tree.c')
-rw-r--r-- | src/lib/device_tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/device_tree.c b/src/lib/device_tree.c index aff9e157cd..4f5cc07e91 100644 --- a/src/lib/device_tree.c +++ b/src/lib/device_tree.c @@ -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); |