summaryrefslogtreecommitdiff
path: root/crypto/xts.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2017-04-05 21:57:07 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2017-04-05 21:57:07 +0800
commit2bc70017e0ccd4cd192fe38b9f48f3f0faeefae2 (patch)
tree3ab82cefbefb6312298945b3622dbde0d4b983aa /crypto/xts.c
parente0d6e111cbe6c91ab907ea3273de71b6ba1e726f (diff)
parent7850b58ce111818befca6f2975adb7c559caa461 (diff)
downloadlinux-crypto-2bc70017e0ccd4cd192fe38b9f48f3f0faeefae2.tar.gz
linux-crypto-2bc70017e0ccd4cd192fe38b9f48f3f0faeefae2.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Merge the crypto tree to resolve conflict between caam changes.
Diffstat (limited to 'crypto/xts.c')
-rw-r--r--crypto/xts.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/xts.c b/crypto/xts.c
index baeb34dd..c976bfac 100644
--- a/crypto/xts.c
+++ b/crypto/xts.c
@@ -230,8 +230,11 @@ static int init_crypt(struct skcipher_request *req, crypto_completion_t done)
subreq->cryptlen = XTS_BUFFER_SIZE;
if (req->cryptlen > XTS_BUFFER_SIZE) {
- subreq->cryptlen = min(req->cryptlen, (unsigned)PAGE_SIZE);
- rctx->ext = kmalloc(subreq->cryptlen, gfp);
+ unsigned int n = min(req->cryptlen, (unsigned int)PAGE_SIZE);
+
+ rctx->ext = kmalloc(n, gfp);
+ if (rctx->ext)
+ subreq->cryptlen = n;
}
rctx->src = req->src;