All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5] fjes: Check for error irq
@ 2021-12-24  1:34 Jiasheng Jiang
  2021-12-24  3:14 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: Jiasheng Jiang @ 2021-12-24  1:34 UTC (permalink / raw)
  To: robin.murphy, andy.shevchenko, davem, kuba, yangyingliang, sashal
  Cc: netdev, linux-kernel, Jiasheng Jiang

The platform_get_irq() is possible to fail.
And the returned irq could be error number and will finally cause the
failure of the request_irq().
Consider that platform_get_irq() can now in certain cases return
-EPROBE_DEFER, and the consequences of letting request_irq() effectively
convert that into -EINVAL, even at probe time rather than later on.
So it might be better to check just now.

Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
Changelog:

v4 -> v5

*Change 1. Using error variable to check.
*Change 2. Correct the word.
*Change 3. Add new commit message.
*Change 4. Refine the commit message to be more reasonable.
---
 drivers/net/fjes/fjes_main.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index e449d9466122..17f2fd937e4d 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1268,7 +1268,12 @@ 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);
+
+	err = platform_get_irq(plat_dev, 0);
+	if (err < 0)
+		goto err_free_control_wq;
+	hw->hw_res.irq = err;
+
 	err = fjes_hw_init(&adapter->hw);
 	if (err)
 		goto err_free_control_wq;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v5] fjes: Check for error irq
  2021-12-24  1:34 [PATCH v5] fjes: Check for error irq Jiasheng Jiang
@ 2021-12-24  3:14 ` Jakub Kicinski
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2021-12-24  3:14 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: robin.murphy, andy.shevchenko, davem, yangyingliang, sashal,
	netdev, linux-kernel

On Fri, 24 Dec 2021 09:34:45 +0800 Jiasheng Jiang wrote:
> The platform_get_irq() is possible to fail.
> And the returned irq could be error number and will finally cause the
> failure of the request_irq().
> Consider that platform_get_irq() can now in certain cases return
> -EPROBE_DEFER, and the consequences of letting request_irq() effectively
> convert that into -EINVAL, even at probe time rather than later on.
> So it might be better to check just now.
> 
> Fixes: 658d439b2292 ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>

Please take note of the notifications you're getting. The previous
versions of this and the other two patches you posted shortly after
were already merged into the net tree:

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=db6d6afe382de5a65d6ccf51253ab48b8e8336c3

If you want to refactor the check you need to send an incremental
change (IOW diff against the previously applied patch).

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-24  3:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-24  1:34 [PATCH v5] fjes: Check for error irq Jiasheng Jiang
2021-12-24  3:14 ` Jakub Kicinski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.