Skip to content

Commit 3c08377

Browse files
Ard Biesheuvelherbertx
Ard Biesheuvel
authored andcommitted
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>
1 parent 9166c44 commit 3c08377

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crypto/scompress.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,7 @@ static int scomp_acomp_comp_decomp(struct acomp_req *req, int dir)
211211
scratch_dst, &req->dlen, *ctx);
212212
if (!ret) {
213213
if (!req->dst) {
214-
req->dst = crypto_scomp_sg_alloc(req->dlen,
215-
req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
216-
GFP_KERNEL : GFP_ATOMIC);
214+
req->dst = crypto_scomp_sg_alloc(req->dlen, GFP_ATOMIC);
217215
if (!req->dst)
218216
goto out;
219217
}

0 commit comments

Comments
 (0)