From 3bfe619dc365e439936ed6dae36506944c44c18c Mon Sep 17 00:00:00 2001 From: Jonathan Kliegman Date: Thu, 14 Jun 2012 13:31:55 -0400 Subject: [PATCH] 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 --- drivers/mmc/host/dw_mmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 */ -- 2.20.1