36aeb33d59b71c2035f4510b55856e85df9d0954
[openwrt/staging/chunkeey.git] / target / linux / apm821xx / patches-4.19 / 023-0003-crypto-drop-mask-CRYPTO_ALG_ASYNC-from-cipher-tfm-al.patch
1 From 1ad0f1603a6b2afb62a1c065409aaa4e43ca7627 Mon Sep 17 00:00:00 2001
2 From: Eric Biggers <ebiggers@google.com>
3 Date: Wed, 14 Nov 2018 12:19:39 -0800
4 Subject: [PATCH 03/15] crypto: drop mask=CRYPTO_ALG_ASYNC from 'cipher' tfm
5 allocations
6
7 'cipher' algorithms (single block ciphers) are always synchronous, so
8 passing CRYPTO_ALG_ASYNC in the mask to crypto_alloc_cipher() has no
9 effect. Many users therefore already don't pass it, but some still do.
10 This inconsistency can cause confusion, especially since the way the
11 'mask' argument works is somewhat counterintuitive.
12
13 Thus, just remove the unneeded CRYPTO_ALG_ASYNC flags.
14
15 This patch shouldn't change any actual behavior.
16
17 Signed-off-by: Eric Biggers <ebiggers@google.com>
18 Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
19 ---
20 drivers/crypto/amcc/crypto4xx_alg.c | 3 +--
21 1 file changed, 1 insertion(+), 2 deletions(-)
22
23 --- a/drivers/crypto/amcc/crypto4xx_alg.c
24 +++ b/drivers/crypto/amcc/crypto4xx_alg.c
25 @@ -540,8 +540,7 @@ static int crypto4xx_compute_gcm_hash_ke
26 uint8_t src[16] = { 0 };
27 int rc = 0;
28
29 - aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC |
30 - CRYPTO_ALG_NEED_FALLBACK);
31 + aes_tfm = crypto_alloc_cipher("aes", 0, CRYPTO_ALG_NEED_FALLBACK);
32 if (IS_ERR(aes_tfm)) {
33 rc = PTR_ERR(aes_tfm);
34 pr_warn("could not load aes cipher driver: %d\n", rc);