
On 2/7/22 10:12, Pali Rohár wrote:
Currently it is possible to call "kwboot -b -t /dev/ttyUSB0" but not to call "kwboot -b /dev/ttyUSB0".
Fix it by not trying to process the last argv[], which is non-getopt() option (tty path) as the image path for -b.
Fixes: c513fe47dca2 ("tools: kwboot: Allow to use option -b without image path") Reported-by: Marcel Ziswiler marcel@ziswiler.com Signed-off-by: Pali Rohár pali@kernel.org Reviewed-by: Marcel Ziswiler marcel@ziswiler.com Tested-by: Marcel Ziswiler marcel@ziswiler.com
Applied to u-boot-marvell/master
Thanks, Stefan
tools/kwboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/kwboot.c b/tools/kwboot.c index 7737188f0d0a..68c0ef1f1b07 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -1770,7 +1770,7 @@ main(int argc, char **argv) bootmsg = kwboot_msg_boot; if (prev_optind == optind) goto usage;
if (argv[optind] && argv[optind][0] != '-')
if (optind < argc - 1 && argv[optind] && argv[optind][0] != '-') imgpath = argv[optind++]; break;
Viele Grüße, Stefan Roese