mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
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:ad4b1eb5fb
("KEYS: asym_tpm: Implement encryption operation [ver #2]") Fixes:c08fed7371
("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>
This commit is contained in:
parent
601f0093f2
commit
bea3741445
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user