Skip to contentSkip to conversation

cmd: ximg: Invert check for fit image compression

PATCH In review Stefan Theil 2 participants 2 messages Jan 7, 2019 – Jan 27, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd: ximg: Invert check for fit image compression

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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
cmd/ximg.c +1 -1
index 6880c747f5..8572a67a00 100644
@@ -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",
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Stefan Theil

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190126/de506abd/attachment.sig>