efi_loader: efi_variable_parse_signature() returns NULL on error
authorPatrick Wildt <patrick@blueri.se>
Thu, 7 May 2020 00:13:18 +0000 (02:13 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 7 May 2020 16:23:16 +0000 (18:23 +0200)
efi_variable_parse_signature() returns NULL on error, so IS_ERR()
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@blueri.se>
Reviewed-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
lib/efi_loader/efi_variable.c

index 568bd3ccfdcf9476a8da924536ae232725e60f30..60c1201757842f59b07291cf130e07ebdc048902 100644 (file)
@@ -524,9 +524,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;
        }