Commit ae854643 authored by Brent Taylor's avatar Brent Taylor Committed by Greg Kroah-Hartman

mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config

commit 93c77d29 upstream.

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: default avatarBrent Taylor <motobud@gmail.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6576116d
...@@ -2443,7 +2443,7 @@ static int atmci_configure_dma(struct atmel_mci *host) ...@@ -2443,7 +2443,7 @@ static int atmci_configure_dma(struct atmel_mci *host)
struct mci_platform_data *pdata = host->pdev->dev.platform_data; struct mci_platform_data *pdata = host->pdev->dev.platform_data;
dma_cap_mask_t mask; dma_cap_mask_t mask;
if (!pdata->dma_filter) if (!pdata || !pdata->dma_filter)
return -ENODEV; return -ENODEV;
dma_cap_zero(mask); dma_cap_zero(mask);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment