]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: fix an IS_ERR() vs NULL check
authorDan Carpenter <dan.carpenter@linaro.org>
Thu, 27 Jul 2023 07:16:20 +0000 (10:16 +0300)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Thu, 3 Aug 2023 07:21:02 +0000 (09:21 +0200)
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.carpenter@linaro.org>
Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/efi_capsule.c

index ddf8153e09829ca1d9fe3b9474d90e7ec090e790..af8a2ee940ce84aef172194d4a12bf511c65e9c2 100644 (file)
@@ -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;
        }