[CRYPTO]: Only reschedule if !in_atomic()
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 23 May 2005 19:36:25 +0000 (12:36 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 23 May 2005 19:36:25 +0000 (12:36 -0700)
The netlink gfp_any() problem made me double-check the uses of in_softirq()
in crypto/*.  It seems to me that we should be checking in_atomic() instead
of in_softirq() in crypto_yield.  Otherwise people calling the crypto ops
with spin locks held or preemption disabled will get burnt, right?

Signed-off-by: David S. Miller <davem@davemloft.net>
crypto/internal.h

index e68e438..964b9a6 100644 (file)
@@ -38,7 +38,7 @@ static inline void crypto_kunmap(void *vaddr, int out)
 
 static inline void crypto_yield(struct crypto_tfm *tfm)
 {
-       if (!in_softirq())
+       if (!in_atomic())
                cond_resched();
 }