cmd: ximg: Invert check for fit image compression
authorStefan Theil <stefan.theil@mixed-mode.de>
Mon, 7 Jan 2019 09:25:52 +0000 (10:25 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 25 Jan 2019 17:12:55 +0000 (12:12 -0500)
The imgextract command runs a number of checks of
the specified fit. Where it checks for a load address
for compressed images the logic in the expression
is inverted as fit_image_check_comp returns 1 on
success and not 0.

cmd/ximg.c

index 6880c747f5b7c28f7f068b96a1790d039cad1eda..8572a67a0063e224bf5381dd66ddcc61b49836ce 100644 (file)
@@ -143,7 +143,7 @@ do_imgextract(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
                        return 1;
                }
 
-               if (fit_image_check_comp(fit_hdr, noffset, IH_COMP_NONE)
+               if (!fit_image_check_comp(fit_hdr, noffset, IH_COMP_NONE)
                    && (argc < 4)) {
                        printf("Must specify load address for %s command "
                                "with compressed image\n",