提交 93c77d29 编写于 作者: B Brent Taylor 提交者: Ulf Hansson

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: NBrent Taylor <motobud@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 a0747eb8
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册