From: Jaehoon Chung <jh80.chung@samsung.com>
To: linux-mmc <linux-mmc@vger.kernel.org>
Cc: Chris Ball <cjb@laptop.org>, Will Newton <will.newton@imgtec.com>,
James Hogan <james.hogan@imgtec.com>,
Kyungmin Park <kyungmin.park@samsung.com>
Subject: [PATCH] dw-mmc: prevent the Null pointer dereference for dma_ops
Date: Wed, 18 Apr 2012 15:42:31 +0900 [thread overview]
Message-ID: <4F8E6257.5010603@samsung.com> (raw)
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
next reply other threads:[~2012-04-18 6:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-18 6:42 Jaehoon Chung [this message]
2012-04-18 10:02 ` [PATCH] dw-mmc: prevent the Null pointer dereference for dma_ops Will Newton
2012-04-19 0:02 ` Chris Ball
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F8E6257.5010603@samsung.com \
--to=jh80.chung@samsung.com \
--cc=cjb@laptop.org \
--cc=james.hogan@imgtec.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-mmc@vger.kernel.org \
--cc=will.newton@imgtec.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.