summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-04-11 07:40:42 +1000
committerDave Airlie <airlied@redhat.com>2017-04-11 07:40:42 +1000
commit6cb091b20525a60b56deb8f851a99fc16960f2ee (patch)
tree8c207c60f5043c5c492011f2d5da37f93a062959
parent9d35114e78bdac3f2e36fc0ba928322209717f90 (diff)
parent69ef4995da43c512ffa7d4e57d5124489a0b417f (diff)
downloadlinux-crypto-6cb091b20525a60b56deb8f851a99fc16960f2ee.tar.gz
linux-crypto-6cb091b20525a60b56deb8f851a99fc16960f2ee.zip
Backmerge tag 'v4.11-rc6' into drm-next
Linux 4.11-rc6 drm-misc needs 4.11-rc5, may as well fix conflicts with rc6.
-rw-r--r--crypto/lrw.c7
-rw-r--r--crypto/xts.c7
2 files changed, 10 insertions, 4 deletions
diff --git a/crypto/lrw.c b/crypto/lrw.c
index ecd84740..3ea095ad 100644
--- a/crypto/lrw.c
+++ b/crypto/lrw.c
@@ -286,8 +286,11 @@ static int init_crypt(struct skcipher_request *req, crypto_completion_t done)
subreq->cryptlen = LRW_BUFFER_SIZE;
if (req->cryptlen > LRW_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;
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;