[PATCH] fjes: Check for error irq

Subsystems: networking drivers, the rest

STALE1755d

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

[PATCH] fjes: Check for error irq

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

I find that platform_get_irq() will not always succeed.
It will return error irq in case of the failure.
Therefore, it might be better to check it if order to avoid the use of
error irq.

Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: Jiasheng Jiang <redacted>
---
 drivers/net/fjes/fjes_main.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index e449d9466122..2a569eea4ee8 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1269,6 +1269,11 @@ static int fjes_probe(struct platform_device *plat_dev)
 	hw->hw_res.start = res->start;
 	hw->hw_res.size = resource_size(res);
 	hw->hw_res.irq = platform_get_irq(plat_dev, 0);
+	if (hw->hw_res.irq < 0) {
+		err = hw->hw_res.irq;
+		goto err_free_control_wq;
+	}
+
 	err = fjes_hw_init(&adapter->hw);
 	if (err)
 		goto err_free_control_wq;
-- 
2.25.1

Re: [PATCH] fjes: Check for error irq

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

Hello:

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

On Wed, 22 Dec 2021 15:12:07 +0800 you wrote:
I find that platform_get_irq() will not always succeed.
It will return error irq in case of the failure.
Therefore, it might be better to check it if order to avoid the use of
error irq.

Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: Jiasheng Jiang <redacted>

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

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