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

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Apr 21 07:02:58 UTC 2019


On 4/19/19 5:22 AM, AKASHI Takahiro wrote:
> In the current implementation, bootefi command and EFI boot manager
> don't use load_image API, instead, use more primitive and internal
> functions. This will introduce duplicated code and potentially
> unknown bugs as well as inconsistent behaviours.
>
> With this patch, do_efibootmgr() and do_boot_efi() are completely
> overhauled and re-implemented using load_image API.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>

<snip />

> +err_prepare:
> +	if (device_path)
> +		efi_free_pool(file_path);

This free is duplicate to the one below. And why should freeing
file_path depend on device_path?

Regards Heinrich

> +
> +err_add_protocol:
> +	if (mem_handle)
> +		efi_delete_handle(mem_handle);
> +	if (file_path) /* hence memdp */
> +		efi_free_pool(file_path);
>
>  	if (ret != EFI_SUCCESS)
>  		return CMD_RET_FAILURE;
> -	else
> -		return CMD_RET_SUCCESS;
> +
> +	return CMD_RET_SUCCESS;
>  }


More information about the U-Boot mailing list