Skip to content

Commit c365c14

Browse files
fltogregkh
authored andcommitted
efi/libstub: fix efi_parse_options() ignoring the default command line
[ Upstream commit aacfa0e ] 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: 60f38de ("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>
1 parent f93e580 commit c365c14

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/firmware/efi/libstub/efi-stub.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ efi_status_t efi_handle_cmdline(efi_loaded_image_t *image, char **cmdline_ptr)
129129

130130
if (IS_ENABLED(CONFIG_CMDLINE_EXTEND) ||
131131
IS_ENABLED(CONFIG_CMDLINE_FORCE) ||
132-
cmdline_size == 0) {
132+
cmdline[0] == 0) {
133133
status = efi_parse_options(CONFIG_CMDLINE);
134134
if (status != EFI_SUCCESS) {
135135
efi_err("Failed to parse options\n");

0 commit comments

Comments
 (0)