Skip to contentSkip to conversation

net: ag71xx: check error for platform_get_irq

PATCH Superseded Rosen Penev 2 participants 2 messages May 15

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: ag71xx: check error for platform_get_irq

Exit probe if the proper IRQ cannot be found.

Fixes d51b6ce441d3 ("net: ethernet: add ag71xx driver")
---
 drivers/net/ethernet/atheros/ag71xx.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/atheros/ag71xx.c +3 -0
index a5ab99474179..4e4794c4dfdc 100644
@@ -1856,6 +1856,9 @@ static int ag71xx_probe(struct platform_device *pdev)
 	ag71xx_int_disable(ag, AG71XX_INT_POLL);
 
 	ndev->irq = platform_get_irq(pdev, 0);
+	if (ndev->irq < 0)
+		return ndev->irq;
+
 	err = devm_request_irq(&pdev->dev, ndev->irq, ag71xx_interrupt,
 			       0x0, dev_name(&pdev->dev), ndev);
 	if (err) {
Signature · 1 line
2.54.0
#1 lore raw
Quoted 1 line

Exit probe if the proper IRQ cannot be found.

Would a summary phrase like “Complete error handling for a failed platform_get_irq() call” be nicer?

Regards,
Markus