Skip to content

Commit

Permalink
[CRYPTO]: Only reschedule if !in_atomic()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
herbertx authored and davem330 committed May 23, 2005
1 parent 3143241 commit 1533303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crypto/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 1533303

Please sign in to comment.