Skip to content

Commit

Permalink
crypto: chelsio - Avoid some code duplication
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
tititiou36 authored and herbertx committed Jul 16, 2020
1 parent e456ef6 commit d110cf0
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/crypto/chelsio/chcr_algo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d110cf0

Please sign in to comment.