Skip to content

Commit

Permalink
mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA c…
Browse files Browse the repository at this point in the history
…onfig

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 <motobud@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
  • Loading branch information
Brent Taylor authored and Ulf Hansson committed Mar 17, 2016
1 parent a0747eb commit 93c77d2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/host/atmel-mci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 93c77d2

Please sign in to comment.