* [patch] mmc: dw_mmc: NULL dereference in error message
@ 2015-10-22 19:53 Dan Carpenter
2015-10-23 0:58 ` Jaehoon Chung
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-10-22 19:53 UTC (permalink / raw)
To: Seungwon Jeon; +Cc: Jaehoon Chung, Ulf Hansson, linux-mmc, kernel-janitors
The "host->dms->ch" pointer is NULL here so we can't use it to print the
error message.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 6e600e8..f877b2c 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -752,9 +752,7 @@ static int dw_mci_edmac_init(struct dw_mci *host)
host->dms->ch = dma_request_slave_channel(host->dev, "rx-tx");
if (!host->dms->ch) {
- dev_err(host->dev,
- "Failed to get external DMA channel %d\n",
- host->dms->ch->chan_id);
+ dev_err(host->dev, "Failed to get external DMA channel.\n");
kfree(host->dms);
host->dms = NULL;
return -ENXIO;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] mmc: dw_mmc: NULL dereference in error message
2015-10-22 19:53 [patch] mmc: dw_mmc: NULL dereference in error message Dan Carpenter
@ 2015-10-23 0:58 ` Jaehoon Chung
0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2015-10-23 0:58 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Ulf Hansson, linux-mmc, kernel-janitors, CPGS
Hi,
Thanks for pointing out.
I will pick this patch at my repository.
Best Regards,
Jaehoon Chung
On 10/23/2015 04:53 AM, Dan Carpenter wrote:
> The "host->dms->ch" pointer is NULL here so we can't use it to print the
> error message.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 6e600e8..f877b2c 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -752,9 +752,7 @@ static int dw_mci_edmac_init(struct dw_mci *host)
>
> host->dms->ch = dma_request_slave_channel(host->dev, "rx-tx");
> if (!host->dms->ch) {
> - dev_err(host->dev,
> - "Failed to get external DMA channel %d\n",
> - host->dms->ch->chan_id);
> + dev_err(host->dev, "Failed to get external DMA channel.\n");
> kfree(host->dms);
> host->dms = NULL;
> return -ENXIO;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-23 0:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-22 19:53 [patch] mmc: dw_mmc: NULL dereference in error message Dan Carpenter
2015-10-23 0:58 ` Jaehoon Chung
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).