From: Chuansheng Liu Date: Tue, 5 Nov 2013 06:52:45 +0000 (+0800) Subject: mmc: sdhci: Setting the host->mrq to NULL before executing tuning X-Git-Tag: v3.14-rc1~88^2~39 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63c211803a272d59dcb11af82ad0364b3d1d2a2e;p=pandora-kernel.git mmc: sdhci: Setting the host->mrq to NULL before executing tuning In function sdhci_request(), it is possible to do the tuning execution like below: sdhci_request() { spin_lock_irqsave(&host->lock, flags); host->mrq = mrq; ... spin_unlock_irqrestore(&host->lock, flags); <=== Here it is possible one pending finish_tasklet get running and it will operate the original mrq, and notified the mrq is done, and causes memory corruption. sdhci_execute_tuning(mmc, tuning_opcode); spin_lock_irqsave(&host->lock, flags); host->mrq = mrq; ... } In the above race place, the original mrq should not be finished wrongly, so here before unlock the spinlock, we need to set the host->mrq to NULL to avoid this case. Signed-off-by: Liu, Chuansheng Signed-off-by: Chris Ball --- Reading git-diff-tree failed