Merge tag 'u-boot-nand-20230417' of https://source.denx.de/u-boot/custodians/u-boot...
[platform/kernel/u-boot.git] / common / avb_verify.c
index a2b7396..48ba8db 100644 (file)
@@ -7,7 +7,6 @@
 #include <avb_verify.h>
 #include <blk.h>
 #include <cpu_func.h>
-#include <fastboot.h>
 #include <image.h>
 #include <malloc.h>
 #include <part.h>
@@ -370,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;
        }
@@ -620,10 +619,11 @@ static int get_open_session(struct AvbOpsData *ops_data)
                memset(&arg, 0, sizeof(arg));
                tee_optee_ta_uuid_to_octets(arg.uuid, &uuid);
                rc = tee_open_session(tee, &arg, 0, NULL);
-               if (!rc) {
-                       ops_data->tee = tee;
-                       ops_data->session = arg.session;
-               }
+               if (rc || arg.ret)
+                       continue;
+
+               ops_data->tee = tee;
+               ops_data->session = arg.session;
        }
 
        return 0;