mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
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>
This commit is contained in:
parent
9166c44358
commit
3c08377262
1 changed files with 1 additions and 3 deletions
|
@ -211,9 +211,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
|
||||||
scratch_dst, &req->dlen, *ctx);
|
scratch_dst, &req->dlen, *ctx);
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
if (!req->dst) {
|
if (!req->dst) {
|
||||||
req->dst = crypto_scomp_sg_alloc(req->dlen,
|
req->dst = crypto_scomp_sg_alloc(req->dlen, GFP_ATOMIC);
|
||||||
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
|
|
||||||
GFP_KERNEL : GFP_ATOMIC);
|
|
||||||
if (!req->dst)
|
if (!req->dst)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue