2017-11-17 23:04:42

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH] mmc: usdhi6rol0: Handle return value of platform_get_irq_byname for card detect

platform_get_irq_byname() can fail here and we must check its return value.

Signed-off-by: Arvind Yadav <[email protected]>
---
drivers/mmc/host/usdhi6rol0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
index cdfeb15..5a896de 100644
--- a/drivers/mmc/host/usdhi6rol0.c
+++ b/drivers/mmc/host/usdhi6rol0.c
@@ -1749,7 +1749,7 @@ static int usdhi6_probe(struct platform_device *pdev)
irq_cd = platform_get_irq_byname(pdev, "card detect");
irq_sd = platform_get_irq_byname(pdev, "data");
irq_sdio = platform_get_irq_byname(pdev, "SDIO");
- if (irq_sd < 0 || irq_sdio < 0)
+ if (irq_cd < 0 || irq_sd < 0 || irq_sdio < 0)
return -ENODEV;

mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
--
2.7.4


From 1585168669044626426@xxx Sun Nov 26 22:17:26 +0000 2017
X-GM-THRID: 1585168669044626426
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread