]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
crypto: skcipher - call cond_resched() directly
authorEric Biggers <ebiggers@google.com>
Sun, 5 Jan 2025 19:34:16 +0000 (11:34 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 14 Jan 2025 03:38:33 +0000 (11:38 +0800)
In skcipher_walk_done(), instead of calling crypto_yield() which
requires a translation between flags, just call cond_resched() directly.
This has the same effect.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/skcipher.c

index 6b62d816f08d1611b9c549ccc3426bb001f2dab1..a9eb2dcf289821e559707324231e24d067a8d4ec 100644 (file)
@@ -146,8 +146,8 @@ unmap_src:
        scatterwalk_done(&walk->out, 1, total);
 
        if (total) {
-               crypto_yield(walk->flags & SKCIPHER_WALK_SLEEP ?
-                            CRYPTO_TFM_REQ_MAY_SLEEP : 0);
+               if (walk->flags & SKCIPHER_WALK_SLEEP)
+                       cond_resched();
                walk->flags &= ~(SKCIPHER_WALK_SLOW | SKCIPHER_WALK_COPY |
                                 SKCIPHER_WALK_DIFF);
                return skcipher_walk_next(walk);