diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-11-19 10:22:47 +0530 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-12-15 09:13:16 +0100 |
commit | 2408a08583d2711f43716b79cb879df66ad407dc (patch) | |
tree | 8faa32d218d2fcad3fb797bff51a5e0f77ad6031 | |
parent | 682798a596a6f3ffe796ebbf6a9396bed6dc6de2 (diff) | |
download | linux-2408a08583d2711f43716b79cb879df66ad407dc.tar.bz2 |
mmc: sunxi-mmc: 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>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/sunxi-mmc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 8fef5c17696e..bad612d6f879 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -1255,6 +1255,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, goto error_assert_reset; host->irq = platform_get_irq(pdev, 0); + if (host->irq <= 0) { + ret = -EINVAL; + goto error_assert_reset; + } + return devm_request_threaded_irq(&pdev->dev, host->irq, sunxi_mmc_irq, sunxi_mmc_handle_manual_stop, 0, "sunxi-mmc", host); |