[PATCH] drivers: net: smc911x: Check for error irq

Subsystems: networking drivers, the rest

STALE1756d

2 messages, 2 authors, 2021-12-22 · open the first message on its own page

[PATCH] drivers: net: smc911x: Check for error irq

From: Jiasheng Jiang <hidden>
Date: 2021-12-22 07:41:40

Because platform_get_irq() could fail and return error irq.
Therefore, it might be better to check it if order to avoid the use of
error irq.

Fixes: ae150435b59e ("smsc: Move the SMC (SMSC) drivers")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/net/ethernet/smsc/smc911x.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 22cdbf12c823..ce05d79528d7 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2070,6 +2070,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
 
 	ndev->dma = (unsigned char)-1;
 	ndev->irq = platform_get_irq(pdev, 0);
+	if (ndev->irq < 0) {
+		ret = ndev->irq;
+		goto release_both;
+	}
+
 	lp = netdev_priv(ndev);
 	lp->netdev = ndev;
 #ifdef SMC_DYNAMIC_BUS_CONFIG
-- 
2.25.1

Re: [PATCH] drivers: net: smc911x: Check for error irq

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-12-22 10:30:18

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller [off-list ref]:

On Wed, 22 Dec 2021 15:41:12 +0800 you wrote:
Because platform_get_irq() could fail and return error irq.
Therefore, it might be better to check it if order to avoid the use of
error irq.

Fixes: ae150435b59e ("smsc: Move the SMC (SMSC) drivers")
Signed-off-by: Jiasheng Jiang <redacted>

[...]
Here is the summary with links:
  - drivers: net: smc911x: Check for error irq
    https://git.kernel.org/netdev/net/c/cb93b3e11d40

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help