From: Brent Taylor Date: Sun, 13 Mar 2016 06:25:31 +0000 (-0600) Subject: mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=93c77d2999b09f2084b033ea6489915e0104ad9c;p=deliverable%2Flinux.git mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config Using an at91sam9g20ek development board with DTS configuration may trigger a kernel panic because of a NULL pointer dereference exception, while configuring DMA. Let's fix this by adding a check for pdata before dereferencing it. Signed-off-by: Brent Taylor Cc: stable@vger.kernel.org Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 7f9d3de9f870..9268c41a8561 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -2438,7 +2438,7 @@ static int atmci_configure_dma(struct atmel_mci *host) struct mci_platform_data *pdata = host->pdev->dev.platform_data; dma_cap_mask_t mask; - if (!pdata->dma_filter) + if (!pdata || !pdata->dma_filter) return -ENODEV; dma_cap_zero(mask);