summaryrefslogtreecommitdiffstats
path: root/crypto/asymmetric_keys/public_key.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-12-27 09:02:02 +0100
committerTakashi Iwai <tiwai@suse.de>2017-12-27 09:02:02 +0100
commit7ad3423ebb02f340671f70a916bdc8dbec7573ee (patch)
treeb9168d363c24f2af2626e63011ec1f6c81e81d09 /crypto/asymmetric_keys/public_key.c
parent56a23ee52611ca76421f3d7cac100e1616716dae (diff)
parent44be77c590f381bc629815ac789b8b15ecc4ddcf (diff)
downloadtalos-op-linux-7ad3423ebb02f340671f70a916bdc8dbec7573ee.tar.gz
talos-op-linux-7ad3423ebb02f340671f70a916bdc8dbec7573ee.zip
Merge branch 'for-linus' into for-next
Back-merge the upstream branch for applying further cleanup patches for HD-Audio. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'crypto/asymmetric_keys/public_key.c')
-rw-r--r--crypto/asymmetric_keys/public_key.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
index bc3035ef27a2..de996586762a 100644
--- a/crypto/asymmetric_keys/public_key.c
+++ b/crypto/asymmetric_keys/public_key.c
@@ -73,7 +73,7 @@ int public_key_verify_signature(const struct public_key *pkey,
char alg_name_buf[CRYPTO_MAX_ALG_NAME];
void *output;
unsigned int outlen;
- int ret = -ENOMEM;
+ int ret;
pr_devel("==>%s()\n", __func__);
@@ -99,6 +99,7 @@ int public_key_verify_signature(const struct public_key *pkey,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
+ ret = -ENOMEM;
req = akcipher_request_alloc(tfm, GFP_KERNEL);
if (!req)
goto error_free_tfm;
@@ -127,7 +128,7 @@ int public_key_verify_signature(const struct public_key *pkey,
* signature and returns that to us.
*/
ret = crypto_wait_req(crypto_akcipher_verify(req), &cwait);
- if (ret < 0)
+ if (ret)
goto out_free_output;
/* Do the actual verification step. */
@@ -142,6 +143,8 @@ error_free_req:
error_free_tfm:
crypto_free_akcipher(tfm);
pr_devel("<==%s() = %d\n", __func__, ret);
+ if (WARN_ON_ONCE(ret > 0))
+ ret = -EINVAL;
return ret;
}
EXPORT_SYMBOL_GPL(public_key_verify_signature);
OpenPOWER on IntegriCloud