From: Ard Biesheuvel <ardb@kernel.org>
To: linux-efi@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Cc: Ard Biesheuvel <ardb@kernel.org>, linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] efi/libstub/arm: fix spurious message that an initrd was loaded
Date: Sun, 29 Mar 2020 10:05:44 +0200 [thread overview]
Message-ID: <20200329080544.25715-3-ardb@kernel.org> (raw)
In-Reply-To: <20200329080544.25715-1-ardb@kernel.org>
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>
---
drivers/firmware/efi/libstub/arm-stub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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)
--
2.17.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-03-29 8:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-29 8:05 [GIT PULL 0/2] EFI touchups for v5.7 Ard Biesheuvel
2020-03-29 8:05 ` [PATCH 1/2] efi/libstub/arm64: avoid image_base value from efi_loaded_image Ard Biesheuvel
2020-03-29 8:05 ` Ard Biesheuvel [this message]
2020-03-29 10:08 ` [GIT PULL 0/2] EFI touchups for v5.7 Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200329080544.25715-3-ardb@kernel.org \
--to=ardb@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-efi@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).