From ef370a3c30ca4b0a4ccf0c94867640355ba5ff52 Mon Sep 17 00:00:00 2001 From: Adrian Vovk Date: Wed, 30 Oct 2024 15:38:49 -0400 Subject: [PATCH] bootspec: Fixup loading of local addons for UKIs Follow-up for 59b3df9 --- src/shared/bootspec.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 49440dded1..6672c69f57 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -1215,16 +1215,18 @@ static int boot_entries_find_unified( if (r < 0) continue; - if (!GREEDY_REALLOC0(config->entries, config->n_entries + 2)) + if (!GREEDY_REALLOC0(config->entries, config->n_entries + 1)) return log_oom(); - if (boot_entry_load_unified(root, j, p, osrelease, profile, cmdline, config->entries + config->n_entries) < 0) - continue; + BootEntry *entry = config->entries + config->n_entries; - config->n_entries++; + if (boot_entry_load_unified(root, j, p, osrelease, profile, cmdline, entry) < 0) + continue; /* look for .efi.extra.d */ - (void) boot_entries_find_unified_local_addons(config, dirfd(d), de->d_name, full, config->entries + config->n_entries); + (void) boot_entries_find_unified_local_addons(config, dirfd(d), de->d_name, full, entry); + + config->n_entries++; } } -- 2.25.1