diff --git a/kernelflinger.c b/kernelflinger.c index 2744162e..aa2715dc 100644 --- a/kernelflinger.c +++ b/kernelflinger.c @@ -1212,13 +1212,15 @@ static EFI_STATUS load_image(VOID *bootimage, VOID *vendorbootimage, UINT8 boot_ efi_perror(ret, L"Failed to set os secure boot"); #endif - if (tee_tpm && is_bootimg_target(boot_target)) { +#ifdef USE_IVSHMEM + if (is_bootimg_target(boot_target)) { ret = ivsh_send_rot_data(bootimage, boot_state, vb_data); if (EFI_ERROR(ret)) { debug(L"Unable to send the root of trust data to optee"); die(); } } +#endif /* install acpi tables before starting trusty */ ret = setup_acpi_table(bootimage, boot_target); diff --git a/libadb/reader.c b/libadb/reader.c index 1f0fdadc..870f2120 100644 --- a/libadb/reader.c +++ b/libadb/reader.c @@ -523,6 +523,7 @@ static EFI_STATUS vmcore_build_header(reader_ctx_t *ctx, void *priv_p) if (priv->m.end && end > priv->m.end) { length -= end - priv->m.end; + end = priv->m.end; } priv->hdr.phnum++; @@ -580,7 +581,7 @@ static EFI_STATUS vmcore_read(reader_ctx_t *ctx, unsigned char **buf, UINT64 *le /* Start new memory region */ if (priv->m.cur == priv->m.cur_end) { - if (priv->cur_phdr >= priv->hdr.phnum - 1) { + if (priv->cur_phdr == priv->hdr.phnum - 1) { error(L"Invalid parameter in %a", __func__); return EFI_INVALID_PARAMETER; } diff --git a/libfastboot/flash.c b/libfastboot/flash.c index e80f3dda..2072e3d5 100644 --- a/libfastboot/flash.c +++ b/libfastboot/flash.c @@ -659,12 +659,10 @@ EFI_STATUS erase_by_label(CHAR16 *label) if (!CompareGuid(&p_gparti->part.type, &EfiPartTypeSystemPartitionGuid)) return gpt_refresh(); -#ifdef USER if (is_data) userdata_erased = TRUE; if (is_share_data) share_data_erased = TRUE; -#endif return EFI_SUCCESS; } diff --git a/libkernelflinger/fatfs/source/ff.c b/libkernelflinger/fatfs/source/ff.c index de8d9b0c..6d659071 100644 --- a/libkernelflinger/fatfs/source/ff.c +++ b/libkernelflinger/fatfs/source/ff.c @@ -5171,7 +5171,7 @@ FRESULT f_mkdir ( res = sync_fs(fs); } } else { - res = remove_chain(&sobj, dcl, 0); /* Could not register, remove the allocated cluster */ + remove_chain(&sobj, dcl, 0); /* Could not register, remove the allocated cluster */ } } FREE_NAMBUF();