From: Pali Rohár <pali@kernel.org>
Date: Tue, 25 Jan 2022 17:13:12 +0000 (+0100)
Subject: tools: kwboot: Fix usage of -D without -t
X-Git-Tag: v2025.01-rc5-pxa1908~1557^2~2
X-Git-Url: http://git.dujemihanovic.xyz/img/static/gitweb.css?a=commitdiff_plain;h=a3c6496bb2e19e7ae8618ae70ee13aecebfaaf88;p=u-boot.git

tools: kwboot: Fix usage of -D without -t

When -D is specified then both bootmsg and debugmsg are not set, but
imgpath is set. Fix this check for valid and required parameters.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
---

diff --git a/tools/kwboot.c b/tools/kwboot.c
index fca1c73c55..859559fb72 100644
--- a/tools/kwboot.c
+++ b/tools/kwboot.c
@@ -1819,7 +1819,7 @@ main(int argc, char **argv)
 		}
 	} while (1);
 
-	if (!bootmsg && !term && !debugmsg)
+	if (!bootmsg && !term && !debugmsg && !imgpath)
 		goto usage;
 
 	ttypath = argv[optind++];