diff options
author | Brent Taylor <motobud@gmail.com> | 2016-03-13 00:25:31 -0600 |
---|---|---|
committer | Sasha Levin <sasha.levin@oracle.com> | 2016-04-18 08:51:01 -0400 |
commit | 0db0888f18f37d9ee10e99a7f3e90861b4d525a2 (patch) | |
tree | 8f2780dec4f138aab2547f0b5b76eb82b3bd2fa8 /drivers/mmc/host | |
parent | 7fa28eeed844c4388957095e5c485eb6f87a14de (diff) |
mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
[ Upstream commit 93c77d2999b09f2084b033ea6489915e0104ad9c ]
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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/mmc/host')
-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 576e96f6ccd0..0c864eb21f58 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -2286,7 +2286,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); |