瀏覽代碼

mmc: add a might_sleep() to mmc_claim_host()

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>
Pierre Ossman 18 年之前
父節點
當前提交
cf795bfb3a
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/mmc/core/core.c

+ 2 - 0
drivers/mmc/core/core.c

@@ -260,6 +260,8 @@ void mmc_claim_host(struct mmc_host *host)
 	DECLARE_WAITQUEUE(wait, current);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
 	unsigned long flags;
 
 
+	might_sleep();
+
 	add_wait_queue(&host->wq, &wait);
 	add_wait_queue(&host->wq, &wait);
 	spin_lock_irqsave(&host->lock, flags);
 	spin_lock_irqsave(&host->lock, flags);
 	while (1) {
 	while (1) {