]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Fix broken verify functionality in crc32 command
authorJoe Hershberger <joe.hershberger@ni.com>
Tue, 5 May 2015 17:23:53 +0000 (12:23 -0500)
committerTom Rini <trini@konsulko.com>
Sun, 10 May 2015 13:59:37 +0000 (09:59 -0400)
Introduced in change d20a40de9db07de1f1f06a79a4da1cdda5379b75
"Roll crc32 into hash infrastructure"

The crc32 command with no -v expects an optional 3rd argument to be an
address to store the result in. With the -v switch, the last argument
is a crc, not an address. In the case where -v is set, we should set the
HASH_FLAG_ENV flag since that will first look for the value to be a
digest value, which matches the expected API for the crc32 command.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/cmd_mem.c

index b91adb29c95d32fa9b07b268c0c4065eb60ffaaf..2e85d53dd23c02902b6e4973ad3cb2e98bbda678 100644 (file)
@@ -1227,7 +1227,7 @@ static int do_mem_crc(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
        ac = argc - 1;
 #ifdef CONFIG_HASH_VERIFY
        if (strcmp(*av, "-v") == 0) {
-               flags |= HASH_FLAG_VERIFY;
+               flags |= HASH_FLAG_VERIFY | HASH_FLAG_ENV;
                av++;
                ac--;
        }