[PATCH] efi_loader: variable: fix an reachable statement

Heinrich Schuchardt xypron.glpk at gmx.de
Fri May 8 16:15:07 CEST 2020


On 08.05.20 07:51, AKASHI Takahiro wrote:
> The code should jump into error recovery instead of just returning
> an error.
>
> Signed-off-by: AKASHI Takahiro <takahiro.akashi at linaro.org>
> Reported-by: Coverity (CID 300332)

I already a patch with the same change:
[PATCH 1/1] efi_loader: error handling in efi_set_variable_common()
https://lists.denx.de/pipermail/u-boot/2020-May/410590.html

Best regards

Heinrich

> ---
>  lib/efi_loader/efi_variable.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
> index 5b86b77c6660..f40b194b13bf 100644
> --- a/lib/efi_loader/efi_variable.c
> +++ b/lib/efi_loader/efi_variable.c
> @@ -1094,7 +1094,7 @@ efi_status_t EFIAPI efi_set_variable_common(u16 *variable_name,
>  	if (append) {
>  		old_data = malloc(old_size);
>  		if (!old_data) {
> -			return EFI_OUT_OF_RESOURCES;
> +			ret = EFI_OUT_OF_RESOURCES;
>  			goto err;
>  		}
>  		ret = EFI_CALL(efi_get_variable(variable_name, vendor,
>



More information about the U-Boot mailing list