KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails
Subsystems (3)
PATCH 1/1 KEYS: asymmetric: return ENOMEM if akcipher_request_alloc() fails
From: Eric Biggers <[email protected]>
No error code was being set on this error path.
Fixes ad4b1eb5fb33 ("KEYS: asym_tpm: Implement encryption operation [ver #2]")
Fixes c08fed737126 ("KEYS: Implement encrypt, decrypt and sign for software asymmetric key [ver #2]")
Signed-off-by Eric Biggers <[email protected]>
--- crypto/asymmetric_keys/asym_tpm.c | 1 + crypto/asymmetric_keys/public_key.c | 1 + 2 files changed, 2 insertions(+)
crypto/asymmetric_keys/asym_tpm.c +1 -0
@@ -479,6 +479,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;
crypto/asymmetric_keys/public_key.c +1 -0
@@ -169,6 +169,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;
Signature · 1 line
2.19.1