From: Dan Carpenter Date: Thu, 22 Oct 2015 19:53:46 +0000 (+0300) Subject: mmc: dw_mmc: NULL dereference in error message X-Git-Tag: firefly_0821_release~176^2~850^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4539d36ef2bbf2ee1519e7cfb51c6fdddda3e4e6;p=firefly-linux-kernel-4.4.55.git mmc: dw_mmc: NULL dereference in error message The "host->dms->ch" pointer is NULL here so we can't use it to print the error message. Signed-off-by: Dan Carpenter Signed-off-by: Jaehoon Chung Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index 63eefea9645e..57a9577bc35c 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;