Re: [Buildroot] [PATCH 2/2] Check if bootcurrent is valid before using it
Fiona Klute via buildroot <[email protected]>
| Newsgroups | net.busybox.buildroot |
|---|---|
| Message-ID | <[email protected]> |
Hi Rhidian, I think these patches went to the wrong mailing list, there's no such file in the Buildroot repo. From the path I guess they might be for RAUC. The second one seems to have some indentation issues. Best regards, Fiona Am 24.08.26 um 11:35 schrieb Rhidian De Wit: > Signed-off-by: Rhidian De Wit <[email protected]> > --- > src/bootloaders/efi.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/src/bootloaders/efi.c b/src/bootloaders/efi.c > index 631ea39d..15cbf417 100644 > --- a/src/bootloaders/efi.c > +++ b/src/bootloaders/efi.c > @@ -510,12 +510,15 @@ gchar *r_efi_get_current_bootname(RaucConfig *config, GError **error) > return NULL; > } > > - g_hash_table_iter_init(&iter, config->slots); > - while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) { > - if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) { > - return g_strdup(slot->bootname); > - } > - } > + if (bootcurrent != NULL) > + { > + g_hash_table_iter_init(&iter, config->slots); > + while (g_hash_table_iter_next(&iter, NULL, (gpointer*) &slot)) { > + if (g_strcmp0(slot->bootname, bootcurrent->name) == 0) { > + return g_strdup(slot->bootname); > + } > + } > + } > > g_set_error(error, > R_BOOTCHOOSER_ERROR, _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot