diff options
author | Brent Taylor <motobud@gmail.com> | 2016-03-13 01:25:31 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2016-03-17 09:54:41 -0400 |
commit | 93c77d2999b09f2084b033ea6489915e0104ad9c (patch) | |
tree | 899819f6c2b1a65c8881a6c83f5f1023a793a9d3 | |
parent | a0747eb81c1d106b1408d60452af75cd17a67621 (diff) |
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 <motobud@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/atmel-mci.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
2438 | struct mci_platform_data *pdata = host->pdev->dev.platform_data; | 2438 | struct mci_platform_data *pdata = host->pdev->dev.platform_data; |
2439 | dma_cap_mask_t mask; | 2439 | dma_cap_mask_t mask; |
2440 | 2440 | ||
2441 | if (!pdata->dma_filter) | 2441 | if (!pdata || !pdata->dma_filter) |
2442 | return -ENODEV; | 2442 | return -ENODEV; |
2443 | 2443 | ||
2444 | dma_cap_zero(mask); | 2444 | dma_cap_zero(mask); |