[PATCH] net: broadcom: bcm4908enet: add platform_get_irq_byname error checking
From: Yu Zhe
Date: Fri Sep 09 2022 - 02:26:58 EST
The platform_get_irq_byname() function returns negative error codes on error,
check it.
Signed-off-by: Yu Zhe <yuzhe@xxxxxxxxxxxx>
---
drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bcm4908_enet.c b/drivers/net/ethernet/broadcom/bcm4908_enet.c
index c131d8118489..d985056db6c2 100644
--- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
@@ -705,6 +705,8 @@ static int bcm4908_enet_probe(struct platform_device *pdev)
return netdev->irq;
enet->irq_tx = platform_get_irq_byname(pdev, "tx");
+ if (enet->irq_tx < 0)
+ return enet->irq_tx;
err = dma_set_coherent_mask(dev, DMA_BIT_MASK(32));
if (err)
--
2.11.0