From: Masahiro Yamada Date: Wed, 20 Apr 2016 02:16:26 +0000 (+0900) Subject: mmc: sdhci-pltfm: check return value of platform_get_irq() X-Git-Tag: v4.7-rc1~172^2~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a782cb1fc2407163123fccd01f65da70d4d2cd8;p=thirdparty%2Flinux.git mmc: sdhci-pltfm: check return value of platform_get_irq() The function platform_get_irq() can fail; it returns a negative error code on failure. A negative IRQ number will make sdhci_add_host() fail to request IRQ anyway, but it makes sense to let it fail earlier here. Signed-off-by: Masahiro Yamada Acked-by: Adrian Hunter Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c index 03dbdeb2aab20..24377a34db414 100644 --- a/drivers/mmc/host/sdhci-pltfm.c +++ b/drivers/mmc/host/sdhci-pltfm.c @@ -146,6 +146,11 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, } host->irq = platform_get_irq(pdev, 0); + if (host->irq < 0) { + dev_err(&pdev->dev, "failed to get IRQ number\n"); + ret = host->irq; + goto err_request; + } if (!request_mem_region(iomem->start, resource_size(iomem), mmc_hostname(host->mmc))) {