summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-11-19 05:52:45 +0100
committerUlf Hansson <ulf.hansson@linaro.org>2017-12-15 09:13:16 +0100
commit1b7ba57ecc864173ef42fff7f8c2e9a880b42bd2 (patch)
treeb192f3badbe466da6e15bf592e43b1aff8a1b3b1 /drivers/mmc
parentmmc: s3cmci: Fix platform_get_irq's error checking (diff)
downloadlinux-1b7ba57ecc864173ef42fff7f8c2e9a880b42bd2.tar.xz
linux-1b7ba57ecc864173ef42fff7f8c2e9a880b42bd2.zip
mmc: sdhci-acpi: Handle return value of platform_get_irq
platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-acpi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 264f10327bf9..4065da58789d 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -680,6 +680,10 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
host->hw_name = "ACPI";
host->ops = &sdhci_acpi_ops_dflt;
host->irq = platform_get_irq(pdev, 0);
+ if (host->irq <= 0) {
+ err = -EINVAL;
+ goto err_free;
+ }
host->ioaddr = devm_ioremap_nocache(dev, iomem->start,
resource_size(iomem));