mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
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: 67ce5a763c
("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>
This commit is contained in:

committed by
Anup Patel

parent
37e1544a86
commit
73344d4724
@@ -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);
|
||||
|
Reference in New Issue
Block a user