diff options
author | Salvatore Mesoraca <s.mesoraca16@gmail.com> | 2018-04-09 15:54:47 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-04-21 00:58:34 +0800 |
commit | 6650c4de681ee90ea6da1fc34fb913f60e9bb008 (patch) | |
tree | 6b0aad6025f677271fa95e979ddb04d5083463e1 /crypto/ctr.c | |
parent | 13c935bb09948aef0202574ee12bb089459eb43b (diff) | |
download | lwn-6650c4de681ee90ea6da1fc34fb913f60e9bb008.tar.gz lwn-6650c4de681ee90ea6da1fc34fb913f60e9bb008.zip |
crypto: remove several VLAs
We avoid various VLAs[1] by using constant expressions for block size
and alignment mask.
[1] http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com
Signed-off-by: Salvatore Mesoraca <s.mesoraca16@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/ctr.c')
-rw-r--r-- | crypto/ctr.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/ctr.c b/crypto/ctr.c index 854d924f9d8e..435b75bd619e 100644 --- a/crypto/ctr.c +++ b/crypto/ctr.c @@ -58,7 +58,7 @@ static void crypto_ctr_crypt_final(struct blkcipher_walk *walk, unsigned int bsize = crypto_cipher_blocksize(tfm); unsigned long alignmask = crypto_cipher_alignmask(tfm); u8 *ctrblk = walk->iv; - u8 tmp[bsize + alignmask]; + u8 tmp[MAX_CIPHER_BLOCKSIZE + MAX_CIPHER_ALIGNMASK]; u8 *keystream = PTR_ALIGN(tmp + 0, alignmask + 1); u8 *src = walk->src.virt.addr; u8 *dst = walk->dst.virt.addr; @@ -106,7 +106,7 @@ static int crypto_ctr_crypt_inplace(struct blkcipher_walk *walk, unsigned int nbytes = walk->nbytes; u8 *ctrblk = walk->iv; u8 *src = walk->src.virt.addr; - u8 tmp[bsize + alignmask]; + u8 tmp[MAX_CIPHER_BLOCKSIZE + MAX_CIPHER_ALIGNMASK]; u8 *keystream = PTR_ALIGN(tmp + 0, alignmask + 1); do { |