integrity: remove redundant initialization of variable ret
authorColin Ian King <colin.king@canonical.com>
Wed, 1 Jul 2020 13:46:34 +0000 (14:46 +0100)
committerMimi Zohar <zohar@linux.ibm.com>
Mon, 27 Jul 2020 20:52:09 +0000 (16:52 -0400)
The variable ret is being initialized with a value that is never read
and it is being updated later with a new value.  The initialization is
redundant and can be removed.

Fixes: eb5798f2e28f ("integrity: convert digsig to akcipher api")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: James Morris <jamorris@linux.microsoft.com>
Addresses-Coverity: ("Unused value")
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
security/integrity/digsig_asymmetric.c

index 4e0d677..cfa4127 100644 (file)
@@ -79,7 +79,7 @@ int asymmetric_verify(struct key *keyring, const char *sig,
        struct public_key_signature pks;
        struct signature_v2_hdr *hdr = (struct signature_v2_hdr *)sig;
        struct key *key;
-       int ret = -ENOMEM;
+       int ret;
 
        if (siglen <= sizeof(*hdr))
                return -EBADMSG;