diff options
Diffstat (limited to 'drivers/crypto/caam/caamalg_qi.c')
-rw-r--r-- | drivers/crypto/caam/caamalg_qi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/crypto/caam/caamalg_qi.c b/drivers/crypto/caam/caamalg_qi.c index 6e61cc93c2b0..d7aa7d7ff102 100644 --- a/drivers/crypto/caam/caamalg_qi.c +++ b/drivers/crypto/caam/caamalg_qi.c | |||
@@ -679,10 +679,8 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, | |||
679 | int ret = 0; | 679 | int ret = 0; |
680 | 680 | ||
681 | if (keylen != 2 * AES_MIN_KEY_SIZE && keylen != 2 * AES_MAX_KEY_SIZE) { | 681 | if (keylen != 2 * AES_MIN_KEY_SIZE && keylen != 2 * AES_MAX_KEY_SIZE) { |
682 | crypto_ablkcipher_set_flags(ablkcipher, | ||
683 | CRYPTO_TFM_RES_BAD_KEY_LEN); | ||
684 | dev_err(jrdev, "key size mismatch\n"); | 682 | dev_err(jrdev, "key size mismatch\n"); |
685 | return -EINVAL; | 683 | goto badkey; |
686 | } | 684 | } |
687 | 685 | ||
688 | ctx->cdata.keylen = keylen; | 686 | ctx->cdata.keylen = keylen; |
@@ -715,7 +713,7 @@ static int xts_ablkcipher_setkey(struct crypto_ablkcipher *ablkcipher, | |||
715 | return ret; | 713 | return ret; |
716 | badkey: | 714 | badkey: |
717 | crypto_ablkcipher_set_flags(ablkcipher, CRYPTO_TFM_RES_BAD_KEY_LEN); | 715 | crypto_ablkcipher_set_flags(ablkcipher, CRYPTO_TFM_RES_BAD_KEY_LEN); |
718 | return 0; | 716 | return -EINVAL; |
719 | } | 717 | } |
720 | 718 | ||
721 | /* | 719 | /* |