summaryrefslogtreecommitdiffstats
path: root/drivers/net/fjes
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2021-12-22 15:12:07 +0800
committerDavid S. Miller <davem@davemloft.net>2021-12-22 10:22:13 +0000
commitdb6d6afe382de5a65d6ccf51253ab48b8e8336c3 (patch)
treee129d7813522c1f04b89e1943afb8bbaa965e713 /drivers/net/fjes
parent1c15b05baea71a5ff98235783e3e4ad227760876 (diff)
downloadlinux-stable-db6d6afe382de5a65d6ccf51253ab48b8e8336c3.tar.gz
linux-stable-db6d6afe382de5a65d6ccf51253ab48b8e8336c3.tar.bz2
linux-stable-db6d6afe382de5a65d6ccf51253ab48b8e8336c3.zip
fjes: Check for error irq
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 <jiasheng@iscas.ac.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fjes')
-rw-r--r--drivers/net/fjes/fjes_main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/fjes/fjes_main.c b/drivers/net/fjes/fjes_main.c
index b06c17ac8d4e..ebd287039a54 100644
--- a/drivers/net/fjes/fjes_main.c
+++ b/drivers/net/fjes/fjes_main.c
@@ -1262,6 +1262,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;