[U-Boot] [PATCH 8/9] efi_loader: rework bootmgr/bootefi using load_image API

Heinrich Schuchardt xypron.glpk at gmx.de
Sat Apr 20 08:07:20 UTC 2019


On 4/19/19 5:22 AM, AKASHI Takahiro wrote:
> +	/*
> +	 * FIXME: Who is responsible for
> +	 *	free(loaded_image_info->load_options);
> +	 * Once efi_exit() is implemented correctly,
> +	 * handle itself doesn't exist here.
> +	 */

Load option can only be freed when the image is unloaded. For
applications that will happen when the application call Exit(). For
drivers there is not guarantee that they will be ever unloaded.

In Unload() we should not free load options if they were not allocated
by us but by an EFI binary.

In your implementation you have allocated the load options via calloc()
and not from the EFI pool. So this may allow us to determine whether we
allocated the load options in the Unload() service.

Best regards

Heinrich


More information about the U-Boot mailing list