diff options
| author | Jonathan Marek <jonathan@marek.ca> | 2024-10-13 01:11:56 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-09 10:31:53 +0100 |
| commit | ae0ad16260180476bcf6c575a1beeab6a135c357 (patch) | |
| tree | abf0371c8d79b883cc7b08f9e00da9714b653df0 /drivers | |
| parent | b18f8d9e282717de81a5d5ba5a12bf5a013e5791 (diff) | |
| download | linux-ae0ad16260180476bcf6c575a1beeab6a135c357.tar.gz linux-ae0ad16260180476bcf6c575a1beeab6a135c357.tar.bz2 linux-ae0ad16260180476bcf6c575a1beeab6a135c357.zip | |
efi/libstub: fix efi_parse_options() ignoring the default command line
[ Upstream commit aacfa0ef247b0130b7a98bb52378f8cd727a66ca ]
efi_convert_cmdline() always returns a size of at least 1 because it
counts the NUL terminator, so the "cmdline_size == 0" condition is never
satisfied.
Change it to check if the string starts with a NUL character to get the
intended behavior: to use CONFIG_CMDLINE when load_options_size == 0.
Fixes: 60f38de7a8d4 ("efi/libstub: Unify command line param parsing")
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/firmware/efi/libstub/efi-stub.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/efi/libstub/efi-stub.c b/drivers/firmware/efi/libstub/efi-stub.c index f9c1e8a2bd1d..c5732fb5a565 100644 --- a/drivers/firmware/efi/libstub/efi-stub.c +++ b/drivers/firmware/efi/libstub/efi-stub.c @@ -129,7 +129,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr) if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) || IS_ENABLED(CONFIG_CMDLINE_FORCE) || - cmdline_size == 0) { + cmdline[0] == 0) { status = efi_parse_options(CONFIG_CMDLINE); if (status != EFI_SUCCESS) { efi_err("Failed to parse options\n"); |
