aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/host
diff options
context:
space:
mode:
authorGravatar Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> 2022-05-12 12:49:53 +0530
committerGravatar Ulf Hansson <ulf.hansson@linaro.org> 2022-05-16 15:49:31 +0200
commitded2c4c345001a129293db4bc1fa9ae236ceb0d9 (patch)
treebe3584e63c1265e0b307cefa6c44393836d3bbac /drivers/mmc/host
parentmmc: core: Support zeroout using TRIM for eMMC (diff)
downloadlinux-ded2c4c345001a129293db4bc1fa9ae236ceb0d9.tar.gz
linux-ded2c4c345001a129293db4bc1fa9ae236ceb0d9.tar.bz2
linux-ded2c4c345001a129293db4bc1fa9ae236ceb0d9.zip
mmc: sdhci-of-arasan: Add NULL check for data field
Add NULL check for data field retrieved from of_device_get_match_data() before dereferencing the data. Addresses-coverity: CID 305057:Dereference null return value (NULL_RETURNS) Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Link: https://lore.kernel.org/r/1652339993-27280-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host')
-rw-r--r--drivers/mmc/host/sdhci-of-arasan.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c
index 6a2e5a468424..757801dfc308 100644
--- a/drivers/mmc/host/sdhci-of-arasan.c
+++ b/drivers/mmc/host/sdhci-of-arasan.c
@@ -1577,6 +1577,9 @@ static int sdhci_arasan_probe(struct platform_device *pdev)
const struct sdhci_arasan_of_data *data;
data = of_device_get_match_data(dev);
+ if (!data)
+ return -EINVAL;
+
host = sdhci_pltfm_init(pdev, data->pdata, sizeof(*sdhci_arasan));
if (IS_ERR(host))