[PATCH 10/10] net: ethernet: cpmac: Handle return value of platform_get_irq_byname
From: Arvind Yadav
Date: Sat Dec 02 2017 - 14:27:22 EST
platform_get_irq_byname() can fail here and we must check its return
value
Signed-off-by: Arvind Yadav <arvind.yadav.cs@xxxxxxxxx>
---
drivers/net/ethernet/ti/cpmac.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 9b8a30b..f3acfc0 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1124,6 +1124,10 @@ static int cpmac_probe(struct platform_device *pdev)
}
dev->irq = platform_get_irq_byname(pdev, "irq");
+ if (dev->irq < 0) {
+ rc = dev->irq;
+ goto fail;
+ }
dev->netdev_ops = &cpmac_netdev_ops;
dev->ethtool_ops = &cpmac_ethtool_ops;
--
2.7.4