correct call to free_pages to specify memory size in pages, not bytes.
PATCH 1/1 correct call to free_pages to specify memory size in pages, not bytes.
I found this bug while working on the EFI stub for ARM - free_pages is being passed memory size in bytes instead of pages. Since this is unrelated to ARM, I am submitting this separately from the patch set that adds EFI stub support for ARM. Those patches will depend on this one, since the code in question is moved to a shared location and shared by both x86 and ARM EFI stubs.
Roy Franz (1):
correct call to free_pages to specify memory size in pages, not
bytes.
arch/x86/boot/compressed/eboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
PATCH 1/1 correct call to free_pages to specify memory size in pages, not bytes.
--- arch/x86/boot/compressed/eboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/boot/compressed/eboot.c +1 -1
@@ -225,7 +225,7 @@ static void low_free(unsigned long size, unsigned long addr)unsigned long nr_pages; nr_pages =round_up (size,EFI_PAGE_SIZE ) /EFI_PAGE_SIZE ; -efi_call_phys2 (sys_table->boottime->free_pages, addr, size); +efi_call_phys2 (sys_table->boottime->free_pages, addr, nr_pages); }static void find_bits (unsigned long mask,u8 *pos,u8 *size)
Signature · 1 line
1.7.10.4
Quoted 10 lines · Roy Franz
Signed-off-by Roy Franz <[email protected]>--- arch/x86/boot/compressed/eboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/x86/boot/compressed/eboot.c +0
-0
arch/x86/boot/compressed/eboot.c static void low_free(unsigned long size, unsigned long addr) · line 231
Quoted 8 lines
arch/x86/boot/compressed/eboot.c +1
-1@@ -225,7 +225,7 @@ static void low_free(unsigned long size, unsigned long addr)unsigned long nr_pages; nr_pages =round_up (size,EFI_PAGE_SIZE ) /EFI_PAGE_SIZE ; -efi_call_phys2 (sys_table->boottime->free_pages, addr, size); +efi_call_phys2 (sys_table->boottime->free_pages, addr, nr_pages); }static void find_bits (unsigned long mask,u8 *pos,u8 *size)
Thanks Roy. I pulled this into my urgent queue, as it's obviously a bug and I don't fancy our chances if we ask the firmware to free more memory than it initially allocated.