diff --git a/libkernelflinger/android.c b/libkernelflinger/android.c index 2eb26c17..3f9facc3 100644 --- a/libkernelflinger/android.c +++ b/libkernelflinger/android.c @@ -628,8 +628,10 @@ static EFI_STATUS setup_ramdisk(UINT8 *bootimage, UINT8 *initbootimage, UINT8 *v struct vendor_boot_img_hdr_v4 *vendor_hdr = (struct vendor_boot_img_hdr_v4 *)vendorbootimage; struct boot_img_hdr_v4 *boot_hdr = (struct boot_img_hdr_v4 *)bootimage; - if (initbootimage) - boot_hdr = (struct boot_img_hdr_v4 *)initbootimage; + if (initbootimage) { + boot_hdr = (struct boot_img_hdr_v4 *)initbootimage; + bootimage = initbootimage; + } UINT32 page_size = vendor_hdr->page_size; UINT32 vendor_ramdisk_offset = ALIGN(sizeof(struct vendor_boot_img_hdr_v4), page_size);