aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/asymmetric_keys/public_key.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-10-09 16:03:49 -0700
committerJarkko Sakkinen <jarkko.sakkinen@linux.intel.com>2019-12-12 23:45:16 +0200
commitbea37414453eb08d4ceffeb60a9d490dbc930cea (patch)
tree3883d3b0d8e2b2c5114ebb967f06c4fd0abd1afb /crypto/asymmetric_keys/public_key.c
parentKEYS: remove CONFIG_KEYS_COMPAT (diff)
downloadlinux-dev-bea37414453eb08d4ceffeb60a9d490dbc930cea.tar.xz
linux-dev-bea37414453eb08d4ceffeb60a9d490dbc930cea.zip
KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails
No error code was being set on this error path. Cc: stable@vger.kernel.org Fixes: ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]") Fixes: c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]") Reviewed-by: James Morris <jamorris@linux.microsoft.com> Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Diffstat (limited to '')
-rw-r--r--crypto/asymmetric_keys/public_key.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
index 364b9df9d631..d7f43d4ea925 100644
--- a/crypto/asymmetric_keys/public_key.c
+++ b/crypto/asymmetric_keys/public_key.c
@@ -184,6 +184,7 @@ static int software_key_eds_op(struct kernel_pkey_params *params,
if (IS_ERR(tfm))
return PTR_ERR(tfm);
+ ret = -ENOMEM;
req = akcipher_request_alloc(tfm, GFP_KERNEL);
if (!req)
goto error_free_tfm;