diff options
author | Dave Airlie <airlied@redhat.com> | 2017-04-11 07:40:42 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-04-11 07:40:42 +1000 |
commit | b769fefb68cd70385d68220ae341e5a10723fbc0 (patch) | |
tree | a2881410c9dc5a3474619d155fac981cfbd4ee8f /crypto/xts.c | |
parent | 1420f63b8207e966f54caec26d08abdc2ff37193 (diff) | |
parent | 39da7c509acff13fc8cb12ec1bb20337c988ed36 (diff) | |
download | linux-b769fefb68cd70385d68220ae341e5a10723fbc0.tar.gz linux-b769fefb68cd70385d68220ae341e5a10723fbc0.tar.bz2 linux-b769fefb68cd70385d68220ae341e5a10723fbc0.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.
Diffstat (limited to 'crypto/xts.c')
-rw-r--r-- | crypto/xts.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crypto/xts.c b/crypto/xts.c index baeb34dd8582..c976bfac29da 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; |