aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/eboot.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/boot/compressed/eboot.c')
-rw-r--r--arch/x86/boot/compressed/eboot.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index 4055e63d0b04..fec216f4fbc3 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -643,14 +643,22 @@ grow:
643 u64 size; 643 u64 size;
644 644
645 size = initrds[j].size; 645 size = initrds[j].size;
646 status = efi_call_phys3(fh->read, initrds[j].handle, 646 while (size) {
647 &size, addr); 647 u64 chunksize;
648 if (status != EFI_SUCCESS) 648 if (size > EFI_READ_CHUNK_SIZE)
649 goto free_initrd_total; 649 chunksize = EFI_READ_CHUNK_SIZE;
650 else
651 chunksize = size;
652 status = efi_call_phys3(fh->read,
653 initrds[j].handle,
654 &chunksize, addr);
655 if (status != EFI_SUCCESS)
656 goto free_initrd_total;
657 addr += chunksize;
658 size -= chunksize;
659 }
650 660
651 efi_call_phys1(fh->close, initrds[j].handle); 661 efi_call_phys1(fh->close, initrds[j].handle);
652
653 addr += size;
654 } 662 }
655 663
656 } 664 }