diff options
author | Eric Biggers <ebiggers@google.com> | 2019-10-10 02:03:49 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 2019-12-13 00:45:16 +0300 |
commit | bea37414453eb08d4ceffeb60a9d490dbc930cea (patch) | |
tree | 3883d3b0d8e2b2c5114ebb967f06c4fd0abd1afb /crypto/asymmetric_keys/asym_tpm.c | |
parent | 601f0093f2647db67be40b62e13cd0660990a7c8 (diff) | |
download | linux-bea37414453eb08d4ceffeb60a9d490dbc930cea.tar.xz |
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 'crypto/asymmetric_keys/asym_tpm.c')
-rw-r--r-- | crypto/asymmetric_keys/asym_tpm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/asymmetric_keys/asym_tpm.c b/crypto/asymmetric_keys/asym_tpm.c index d16d893bd195..378b18b9bc34 100644 --- a/crypto/asymmetric_keys/asym_tpm.c +++ b/crypto/asymmetric_keys/asym_tpm.c @@ -470,6 +470,7 @@ static int tpm_key_encrypt(struct tpm_key *tk, if (ret < 0) goto error_free_tfm; + ret = -ENOMEM; req = akcipher_request_alloc(tfm, GFP_KERNEL); if (!req) goto error_free_tfm; |