From: Heinrich Schuchardt Date: Sat, 2 Nov 2024 10:08:35 +0000 (+0100) Subject: cmd: hash: correct parameter count check X-Git-Url: http://git.dujemihanovic.xyz/img/login.html?a=commitdiff_plain;h=6831415e397a95c3220295a6a7d6a686359de35f;p=u-boot.git cmd: hash: correct parameter count check Since commit 348ea878508d ("cmd: hash: fix param count check") the hash command cannot be used without the optional variable name parameter if CONFIG_HASH_VERIFY=y. 'hash sha1 $loadaddr $filesize' returns CMD_RET_USAGE. The minimum number of arguments is four no matter if verification is enabled or not. Fixes: 348ea878508d ("cmd: hash: fix param count check") Signed-off-by: Heinrich Schuchardt Reviewed-by: Igor Opaniuk --- diff --git a/cmd/hash.c b/cmd/hash.c index 60d482b7f8..5b40982b09 100644 --- a/cmd/hash.c +++ b/cmd/hash.c @@ -25,7 +25,7 @@ static int do_hash(struct cmd_tbl *cmdtp, int flag, int argc, char *s; int flags = HASH_FLAG_ENV; - if (argc < (HARGS - 1)) + if (argc < 4) return CMD_RET_USAGE; #if IS_ENABLED(CONFIG_HASH_VERIFY)