]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
avb: Fix error when partition not found
authorschspa <schspa@gmail.com>
Thu, 25 Feb 2021 16:19:10 +0000 (00:19 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 17 Mar 2021 16:50:19 +0000 (12:50 -0400)
part_get_info_by_name will return -1 on error, and >0 on success.

Signed-off-by: schspa <schspa@gmail.com>
Cc: Igor Opaniuk <igor.opaniuk@gmail.com>
Reviewed-by: Igor Opaniuk <igor.opaniuk@gmail.com>
common/avb_verify.c

index db10d0f21fcdb016580b29dfe16da0de49b42525..0520a714556448aab966c919316926462cc866bd 100644 (file)
@@ -369,7 +369,7 @@ static struct mmc_part *get_partition(AvbOps *ops, const char *partition)
        }
 
        ret = part_get_info_by_name(mmc_blk, partition, &part->info);
-       if (!ret) {
+       if (ret < 0) {
                printf("Can't find partition '%s'\n", partition);
                goto err;
        }