]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: atmel-mci: Check pdata for NULL before dereferencing it at DMA config
authorBrent Taylor <motobud@gmail.com>
Sun, 13 Mar 2016 06:25:31 +0000 (00:25 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 14:33:45 +0000 (07:33 -0700)
commit 93c77d2999b09f2084b033ea6489915e0104ad9c 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: Brent Taylor <motobud@gmail.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/atmel-mci.c

index 851ccd9ac868aa0e208cac5d48ee9d8a4eaa5be4..25c1795921255f42d18fc6ee920b1df9aa2c118f 100644 (file)
@@ -2443,7 +2443,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);