]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: fdt: Correct checking of configuration node
authorBin Meng <bmeng@tinylab.org>
Mon, 1 May 2023 03:35:25 +0000 (11:35 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 31 May 2023 21:23:01 +0000 (17:23 -0400)
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>
cmd/fdt.c

index aae3278526c4a34efac461834687d36e55712327..2401ea8b44cbcf82d8c38d89ddd1e4674d9c7bbe 100644 (file)
--- 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;