summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ardb@kernel.org>2020-03-29 10:05:44 +0200
committerIngo Molnar <mingo@kernel.org>2020-03-29 12:08:18 +0200
commit594e576d4b93b8cda3247542366b47e1b2ddc4dc (patch)
treeb90cf1010a424c0f007b3b953570a48113f124e3
parentc2136dceba9a329e997ccce3277d2084e21a8a04 (diff)
downloadlinux-594e576d4b93b8cda3247542366b47e1b2ddc4dc.tar.gz
linux-594e576d4b93b8cda3247542366b47e1b2ddc4dc.tar.bz2
linux-594e576d4b93b8cda3247542366b47e1b2ddc4dc.zip
efi/libstub/arm: Fix spurious message that an initrd was loaded
Commit: ec93fc371f014a6f ("efi/libstub: Add support for loading the initrd from a device path") added a diagnostic print to the ARM version of the EFI stub that reports whether an initrd has been loaded that was passed via the command line using initrd=. However, it failed to take into account that, for historical reasons, the file loading routines return EFI_SUCCESS when no file was found, and the only way to decide whether a file was loaded is to inspect the 'size' argument that is passed by reference. So let's inspect this returned size, to prevent the print from being emitted even if no initrd was loaded at all. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-efi@vger.kernel.org
-rw-r--r--drivers/firmware/efi/libstub/arm-stub.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c
index 13559c7e6643..99a5cde7c2d8 100644
--- a/drivers/firmware/efi/libstub/arm-stub.c
+++ b/drivers/firmware/efi/libstub/arm-stub.c
@@ -277,7 +277,7 @@ efi_status_t efi_entry(efi_handle_t handle, efi_system_table_t *sys_table_arg)
} else if (status == EFI_NOT_FOUND) {
status = efi_load_initrd(image, &initrd_addr, &initrd_size,
ULONG_MAX, max_addr);
- if (status == EFI_SUCCESS)
+ if (status == EFI_SUCCESS && initrd_size > 0)
pr_efi("Loaded initrd from command line option\n");
}
if (status != EFI_SUCCESS)