]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: add missing else
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 18 Feb 2026 01:53:57 +0000 (10:53 +0900)
committerMike Yuan <me@yhndnzj.com>
Wed, 18 Feb 2026 05:37:44 +0000 (06:37 +0100)
Otherwise, OOM error will never checked, and the "preferred" setting
always emits warning that the field is unknown.

Follow-up for 450e0dce02d754d7af599dd99ab40b9363072760.
Fixes CID#1645063.

src/shared/bootspec.c

index 89dfae70c962866289143d6bcfe37697ee8c7bcf..d8ce45475f58f30803e5a120684c56d037a7f4a8 100644 (file)
@@ -519,7 +519,7 @@ int boot_loader_read_conf(BootConfig *config, FILE *file, const char *path) {
 
                 if (streq(field, "preferred"))
                         r = free_and_strdup(&config->preferred_pattern, p);
-                if (streq(field, "default"))
+                else if (streq(field, "default"))
                         r = free_and_strdup(&config->default_pattern, p);
                 else if (STR_IN_SET(field, "timeout", "editor", "auto-entries", "auto-firmware",
                                     "auto-poweroff", "auto-reboot", "beep", "reboot-for-bitlocker",