summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2024-11-14 10:49:30 -0600
committerTom Rini <[email protected]>2024-11-14 10:49:51 -0600
commitf6ee67126492f07d400d677e82467de3f8ad2bda (patch)
treecbf2489ee32bc8132d68621ba3469cdfd675e2f2 /cmd
parenta45d823c0223947848de7031e449e1873032072b (diff)
parent7dfafcd65ef3dc0307a7752ac5a263eb2af56862 (diff)
Merge patch series "cmd: hash: correct parameter count check"
Heinrich Schuchardt <[email protected]> says: 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. Fix the parameter check. Provide a unit test. Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'cmd')
-rw-r--r--cmd/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/hash.c b/cmd/hash.c
index 60d482b7f87..5b40982b098 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)