efi_loader: efi_variable_parse_signature() returns NULL on error

AKASHI Takahiro takahiro.akashi at linaro.org
Thu May 7 09:15:29 CEST 2020


On Thu, May 07, 2020 at 02:13:18AM +0200, Patrick Wildt wrote:
> efi_variable_parse_signature() returns NULL on error, so IS_NULL()
> is an incorrect check.  The goto err leads to pkcs7_free_message(),
> which works fine on a NULL ptr.
> 
> Signed-off-by: Patrick Wildt <patrick at blueri.se>

Reviewed-by: AKASHI Takahiro <takahiro.akashi at linaro.org>

> 
> diff --git a/lib/efi_loader/efi_variable.c b/lib/efi_loader/efi_variable.c
> index 58f8fae358..c5fe896de2 100644
> --- a/lib/efi_loader/efi_variable.c
> +++ b/lib/efi_loader/efi_variable.c
> @@ -519,9 +519,8 @@ static efi_status_t efi_variable_authenticate(u16 *variable,
>  	var_sig = efi_variable_parse_signature(auth->auth_info.cert_data,
>  					       auth->auth_info.hdr.dwLength
>  						   - sizeof(auth->auth_info));
> -	if (IS_ERR(var_sig)) {
> +	if (!var_sig) {
>  		debug("Parsing variable's signature failed\n");
> -		var_sig = NULL;
>  		goto err;
>  	}
>  


More information about the U-Boot mailing list