aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorJaehoon Chung <jh80.chung@samsung.com>2012-04-18 02:42:31 -0400
committerChris Ball <cjb@laptop.org>2012-04-20 21:52:05 -0400
commite1631f989e0c6c8d9b43a2dbdd1097f70da603a5 (patch)
tree4b258ea786edda6cc9903319459143cc10d50775 /drivers/mmc
parentb89152824f993a9572b47eb31f4579feadeac34c (diff)
mmc: dw_mmc: prevent NULL dereference for dma_ops
Now, dma_ops is assumed that use the IDMAC. But if dma_ops is assigned the pdata->dma_ops, we didn't ensure that callback function is defined. If the callback isn't defined, then we should run in PIO mode. Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Will Newton <will.newton@imgtec.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/dw_mmc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index f3b0fcd002df..ab3fc4617107 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -1881,7 +1881,8 @@ static void dw_mci_init_dma(struct dw_mci *host)
1881 if (!host->dma_ops) 1881 if (!host->dma_ops)
1882 goto no_dma; 1882 goto no_dma;
1883 1883
1884 if (host->dma_ops->init) { 1884 if (host->dma_ops->init && host->dma_ops->start &&
1885 host->dma_ops->stop && host->dma_ops->cleanup) {
1885 if (host->dma_ops->init(host)) { 1886 if (host->dma_ops->init(host)) {
1886 dev_err(&host->dev, "%s: Unable to initialize " 1887 dev_err(&host->dev, "%s: Unable to initialize "
1887 "DMA Controller.\n", __func__); 1888 "DMA Controller.\n", __func__);