[PATCH v13 1/9] eficonfig: menu-driven addition of UEFI boot option

Ilias Apalodimas ilias.apalodimas at linaro.org
Wed Aug 24 13:15:30 CEST 2022


Hi Kojima-san,

[...]

> + * eficonfig_destroy() - destroy efimenu
> + *
> + * @efi_menu:	pointer to the efimenu structure
> + * @flag:	flag to free the allocated data
> + */
> +static void eficonfig_destroy(struct efimenu *efi_menu, bool flag)
> +{
> +	struct list_head *pos, *n;
> +	struct eficonfig_entry *entry;
> +
> +	list_for_each_safe(pos, n, &efi_menu->list) {
> +		entry = list_entry(pos, struct eficonfig_entry, list);
> +		free(entry->title);
> +		if (flag)
> +			free(entry->data);

I don't we need this flag.  entry->data is either set to a valid pointer or
NULL on append_entry().

> +		list_del(&entry->list);
> +		free(entry);
> +	}
> +	free(efi_menu->menu_header);
> +	free(efi_menu);

[...]

Regards
/Ilias


More information about the U-Boot mailing list