1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-02-04 17:47:03 +03:00

efi: Skip parsing SystemdOptions if there's an error getting it.

The original logic was logging an "ignored" debug message, but it was still
going ahead and calling proc_cmdline_parse_given() on the NULL line. Fix that
to skip that explicitly when the EFI variable wasn't really read.
This commit is contained in:
Filipe Brandenburger 2020-06-11 15:33:32 -07:00 committed by Zbigniew Jędrzejewski-Szmek
parent 25c86e4c39
commit 7283fbfd0c

View File

@ -121,14 +121,16 @@ int proc_cmdline_parse(proc_cmdline_parse_t parse_item, void *data, ProcCmdlineF
if (!FLAGS_SET(flags, PROC_CMDLINE_IGNORE_EFI_OPTIONS)) {
r = systemd_efi_options_variable(&line);
if (r < 0 && r != -ENODATA)
log_debug_errno(r, "Failed to get SystemdOptions EFI variable, ignoring: %m");
if (r < 0) {
if (r != -ENODATA)
log_debug_errno(r, "Failed to get SystemdOptions EFI variable, ignoring: %m");
} else {
r = proc_cmdline_parse_given(line, parse_item, data, flags);
if (r < 0)
return r;
r = proc_cmdline_parse_given(line, parse_item, data, flags);
if (r < 0)
return r;
line = mfree(line);
line = mfree(line);
}
}
r = proc_cmdline(&line);