From: Herbert Xu Date: Thu, 4 Oct 2007 06:49:00 +0000 (+0800) Subject: [CRYPTO] blkcipher: Increase kmalloc amount to aligned block size X-Git-Tag: v2.6.24-rc1~1454^2~50 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2614de1b9af5a9e49cda64b394e1348159565bd5;p=~emulex%2Finfiniband.git [CRYPTO] blkcipher: Increase kmalloc amount to aligned block size Now that the block size is no longer a multiple of the alignment, we need to increase the kmalloc amount in blkcipher_next_slow to use the aligned block size. Signed-off-by: Herbert Xu --- diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c index a3c87da23f1..3d05586a8f3 100644 --- a/crypto/blkcipher.c +++ b/crypto/blkcipher.c @@ -158,7 +158,7 @@ static inline int blkcipher_next_slow(struct blkcipher_desc *desc, if (walk->buffer) goto ok; - n = bsize * 3 - (alignmask + 1) + + n = aligned_bsize * 3 - (alignmask + 1) + (alignmask & ~(crypto_tfm_ctx_alignment() - 1)); walk->buffer = kmalloc(n, GFP_ATOMIC); if (!walk->buffer)