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 <dan.carpen...@linaro.org>
---
 lib/efi_loader/efi_capsule.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 7a6f195cbc02..c98cff812f10 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;
        }
 
-- 
2.39.2

Reply via email to