]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
crypto: chelsio - Avoid some code duplication
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 12 Jul 2020 21:14:04 +0000 (23:14 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 16 Jul 2020 11:49:14 +0000 (21:49 +1000)
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>
drivers/crypto/chelsio/chcr_algo.c

index 9b68d62149ad21b7b72f4676ab36b0bb6f4a5542..f37744f76b0fc39ac324667e75d5ceb60ce8138d 100644 (file)
@@ -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);