Skip to content

Commit

Permalink
mmc: add a might_sleep() to mmc_claim_host()
Browse files Browse the repository at this point in the history
In the normal case, the host lock can be claimed directly.
When it cannot, the caller will sleep. Make sure we don't
have any latent bugs by always calling might_sleep().

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Pierre Ossman committed Jul 25, 2007
1 parent 67a61c4 commit cf795bf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/mmc/core/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ void mmc_claim_host(struct mmc_host *host)
DECLARE_WAITQUEUE(wait, current);
unsigned long flags;

might_sleep();

add_wait_queue(&host->wq, &wait);
spin_lock_irqsave(&host->lock, flags);
while (1) {
Expand Down

0 comments on commit cf795bf

Please sign in to comment.