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 | 6cb091b20525a60b56deb8f851a99fc16960f2ee (patch) | |
tree | 8c207c60f5043c5c492011f2d5da37f93a062959 /crypto/lrw.c | |
parent | 9d35114e78bdac3f2e36fc0ba928322209717f90 (diff) | |
parent | 69ef4995da43c512ffa7d4e57d5124489a0b417f (diff) | |
download | linux-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.
Diffstat (limited to 'crypto/lrw.c')
-rw-r--r-- | crypto/lrw.c | 7 |
1 files changed, 5 insertions, 2 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; |