aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-04-08 09:37:32 +0200
committerAnup Patel <anup@brainfault.org>2024-04-10 09:38:26 +0530
commit73344d4724d89ab5591311b9badfad875dddbb92 (patch)
treef85ee8834a5968408784dbb19005ccb543fc006b
parent37e1544a86135c8048af77a51486397209529fff (diff)
downloadopensbi-73344d4724d89ab5591311b9badfad875dddbb92.zip
opensbi-73344d4724d89ab5591311b9badfad875dddbb92.tar.gz
opensbi-73344d4724d89ab5591311b9badfad875dddbb92.tar.bz2
lib: utils: check correct value in fdt_node_offset_by_compatible
After calling fdt_node_offset_by_compatible() we must check its return value and not an unrelated value. Addresses-Coverity-ID: 1584993 Logically dead code Fixes: 67ce5a763cfb ("platform: generic: Add support for specify coldboot harts in DT") Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org>
-rw-r--r--lib/utils/fdt/fdt_fixup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c
index 194e55b..974b1b8 100644
--- a/lib/utils/fdt/fdt_fixup.c
+++ b/lib/utils/fdt/fdt_fixup.c
@@ -394,7 +394,7 @@ void fdt_config_fixup(void *fdt)
return;
config_offset = fdt_node_offset_by_compatible(fdt, chosen_offset, "opensbi,config");
- if (chosen_offset < 0)
+ if (config_offset < 0)
return;
fdt_nop_node(fdt, config_offset);