> On 4 Jul 2025, at 2:09 PM, Frediano Ziglio via Grub-devel > <grub-devel@gnu.org> wrote: > > We need to use FOR_LIST_ELEMENTS_SAFE instead of FOR_LIST_ELEMENTS > as single_binary_unload, called during the loop, is changing > the list using grub_list_remove. > Given the environment probably the old code simply deleted only the > first module on the list not freeing all the others. > > Signed-off-by: Frediano Ziglio <frediano.zig...@cloud.com> > ---
Reviewed-by: Sudhakar Kuppusamy <sudha...@linux.ibm.com <mailto:sudha...@linux.ibm.com>> > grub-core/loader/arm64/xen_boot.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/grub-core/loader/arm64/xen_boot.c > b/grub-core/loader/arm64/xen_boot.c > index 26e1472c9..731f1913a 100644 > --- a/grub-core/loader/arm64/xen_boot.c > +++ b/grub-core/loader/arm64/xen_boot.c > @@ -290,9 +290,9 @@ single_binary_unload (struct xen_boot_binary *binary) > static void > all_binaries_unload (void) > { > - struct xen_boot_binary *binary; > + struct xen_boot_binary *binary, *next_binary; > > - FOR_LIST_ELEMENTS (binary, module_head) > + FOR_LIST_ELEMENTS_SAFE (binary, next_binary, module_head) > { > single_binary_unload (binary); > } > -- > 2.43.0 > > > _______________________________________________ > Grub-devel mailing list > Grub-devel@gnu.org > https://lists.gnu.org/mailman/listinfo/grub-devel
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel