Skip to content

Commit

Permalink
mmc: dw_mmc: Fix null dma_ops access when use_dma is false
Browse files Browse the repository at this point in the history
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 <kliegs@chromium.org>
Acked-by: Jaehoon Chung <jh80.chung@samsung.com>
Acked-by: Will Newton <will.newton@imgtec.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
  • Loading branch information
Jonathan Kliegman authored and Chris Ball committed Jul 21, 2012
1 parent e137788 commit 3bfe619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/dw_mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3bfe619

Please sign in to comment.