Skip to content

Commit

Permalink
mmc: sdhci-of-arasan: Add NULL check for data field
Browse files Browse the repository at this point in the history
Add NULL check for data field retrieved from of_device_get_match_data()
before dereferencing the data.
Addresses-coverity: Dereference null return value (NULL_RETURNS)

Signed-off-by: Sai Krishna Potthuri <lakshmi.sai.krishna.potthuri@xilinx.com>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
  • Loading branch information
Sai Krishna Potthuri authored and michalsimek committed May 6, 2022
1 parent d7d99e0 commit b442098
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/mmc/host/sdhci-of-arasan.c
Expand Up @@ -1612,6 +1612,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))
Expand Down

0 comments on commit b442098

Please sign in to comment.