diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-07-21 16:42:36 +0100 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2017-08-03 13:52:44 +0800 |
commit | 3014649037efac090a2c0d806d7f8d0a28a95cb3 (patch) | |
tree | 6f7bcfbf30f377b43ea3e61a1c018aac5fe5d726 /crypto | |
parent | 284f9e00cf2494bf36f2fd36d10510a229a66c41 (diff) | |
download | linux-crypto-3014649037efac090a2c0d806d7f8d0a28a95cb3.tar.gz linux-crypto-3014649037efac090a2c0d806d7f8d0a28a95cb3.zip |
crypto: scompress - don't sleep with preemption disabled
Due to the use of per-CPU buffers, scomp_acomp_comp_decomp() executes
with preemption disabled, and so whether the CRYPTO_TFM_REQ_MAY_SLEEP
flag is set is irrelevant, since we cannot sleep anyway. So disregard
the flag, and use GFP_ATOMIC unconditionally.
Cc: <stable@vger.kernel.org> # v4.10+
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/scompress.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/scompress.c b/crypto/scompress.c index ae1d3cf2..0b40d991 100644 --- a/crypto/scompress.c +++ b/crypto/scompress.c @@ -211,9 +211,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir) scratch_dst, &req->dlen, *ctx); if (!ret) { if (!req->dst) { - req->dst = crypto_scomp_sg_alloc(req->dlen, - req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ? - GFP_KERNEL : GFP_ATOMIC); + req->dst = crypto_scomp_sg_alloc(req->dlen, GFP_ATOMIC); if (!req->dst) goto out; } |