summaryrefslogtreecommitdiff
path: root/drivers/crypto/chelsio
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2020-07-12 23:14:04 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2020-07-16 21:49:14 +1000
commitd110cf0ac1bf24ac098b8ea5b0188c717acf7a02 (patch)
tree1c0c81e213f2dd4a2de933109c65ee605873c74f /drivers/crypto/chelsio
parente456ef6ace3451fa46bd67983345ea758f824865 (diff)
crypto: chelsio - Avoid some code duplication
The error handling path of 'chcr_authenc_setkey()' is the same as this error handling code. So just 'goto out' as done everywhere in the function to simplify the code. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio')
-rw-r--r--drivers/crypto/chelsio/chcr_algo.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/crypto/chelsio/chcr_algo.c b/drivers/crypto/chelsio/chcr_algo.c
index 9b68d62149ad..f37744f76b0f 100644
--- a/drivers/crypto/chelsio/chcr_algo.c
+++ b/drivers/crypto/chelsio/chcr_algo.c
@@ -3598,9 +3598,7 @@ static int chcr_authenc_setkey(struct crypto_aead *authenc, const u8 *key,
base_hash = chcr_alloc_shash(max_authsize);
if (IS_ERR(base_hash)) {
pr_err("chcr : Base driver cannot be loaded\n");
- aeadctx->enckey_len = 0;
- memzero_explicit(&keys, sizeof(keys));
- return -EINVAL;
+ goto out;
}
{
SHASH_DESC_ON_STACK(shash, base_hash);