From: Dan Carpenter Date: Thu, 27 Jul 2023 07:16:20 +0000 (+0300) Subject: efi_loader: fix an IS_ERR() vs NULL check X-Git-Tag: v2023.10-rc2~7^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dae236924ca070fc5ab2aa035f13972191330b4f;p=thirdparty%2Fu-boot.git efi_loader: fix an IS_ERR() vs NULL check The efi_parse_pkcs7_header() function returns NULL on error so the check for IS_ERR() should be changed to a NULL check. Signed-off-by: Dan Carpenter Reviewed-by: Heinrich Schuchardt --- diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c index ddf8153e098..af8a2ee940c 100644 --- a/lib/efi_loader/efi_capsule.c +++ b/lib/efi_loader/efi_capsule.c @@ -368,9 +368,8 @@ efi_status_t efi_capsule_authenticate(const void *capsule, efi_uintn_t capsule_s auth_hdr->auth_info.hdr.dwLength - sizeof(auth_hdr->auth_info), &buf); - if (IS_ERR(capsule_sig)) { + if (!capsule_sig) { debug("Parsing variable's pkcs7 header failed\n"); - capsule_sig = NULL; goto out; }