All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dw-mmc: prevent the Null pointer dereference for dma_ops
@ 2012-04-18  6:42 Jaehoon Chung
  2012-04-18 10:02 ` Will Newton
  0 siblings, 1 reply; 3+ messages in thread
From: Jaehoon Chung @ 2012-04-18  6:42 UTC (permalink / raw)
  To: linux-mmc; +Cc: Chris Ball, Will Newton, James Hogan, Kyungmin Park

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 anything of callback didn't define, then should be run the PIO mode.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/mmc/host/dw_mmc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index f3b0fcd..bab9ead 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)
 	if (!host->dma_ops)
 		goto no_dma;
 
-	if (host->dma_ops->init) {
+	if (host->dma_ops->init && host->dma_ops->start &&
+			host->dma_ops->stop && host->dma_ops->cleanup) {
 		if (host->dma_ops->init(host)) {
 			dev_err(&host->dev, "%s: Unable to initialize "
 				"DMA Controller.\n", __func__);
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-19  0:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-18  6:42 [PATCH] dw-mmc: prevent the Null pointer dereference for dma_ops Jaehoon Chung
2012-04-18 10:02 ` Will Newton
2012-04-19  0:02   ` Chris Ball

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.