aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng@tinylab.org>2023-05-01 11:35:25 +0800
committerTom Rini <trini@konsulko.com>2023-05-31 17:23:01 -0400
commit33c63cea5ee13da6cc7c62443b1f953f74828302 (patch)
treeebc51325bbdf9dd96edfe68a06f0c0a00cf33948
parentc52bd0362dc3830013de290d02ea69181a0ab8e6 (diff)
downloadu-boot-33c63cea5ee13da6cc7c62443b1f953f74828302.zip
u-boot-33c63cea5ee13da6cc7c62443b1f953f74828302.tar.gz
u-boot-33c63cea5ee13da6cc7c62443b1f953f74828302.tar.bz2
cmd: fdt: Correct checking of configuration node
fit_conf_get_node() returns a negative value on error. Signed-off-by: Bin Meng <bmeng@tinylab.org> Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r--cmd/fdt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/fdt.c b/cmd/fdt.c
index aae3278..2401ea8 100644
--- a/cmd/fdt.c
+++ b/cmd/fdt.c
@@ -733,7 +733,7 @@ static int do_fdt(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
gd->fdt_blob = blob;
cfg_noffset = fit_conf_get_node(working_fdt, NULL);
- if (!cfg_noffset) {
+ if (cfg_noffset < 0) {
printf("Could not find configuration node: %s\n",
fdt_strerror(cfg_noffset));
return CMD_RET_FAILURE;