From: Jonathan Kliegman Date: Thu, 14 Jun 2012 17:31:55 +0000 (-0400) Subject: mmc: dw_mmc: Fix null dma_ops access when use_dma is false X-Git-Tag: firefly_0821_release~3680^2~2409^2~49 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3bfe619dc365e439936ed6dae36506944c44c18c;p=firefly-linux-kernel-4.4.55.git mmc: dw_mmc: Fix null dma_ops access when use_dma is false host->dma_ops is not valid if host->usa dma is 0 so protect host->dma_ops reference in dw_mci_resume Signed-off-by: Jonathan Kliegman Acked-by: Jaehoon Chung Acked-by: Will Newton Signed-off-by: Chris Ball --- diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 5a600b3b3199..72dc3cde646d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -2186,7 +2186,7 @@ int dw_mci_resume(struct dw_mci *host) return ret; } - if (host->dma_ops->init) + if (host->use_dma && host->dma_ops->init) host->dma_ops->init(host); /* Restore the old value at FIFOTH register */