]> git.baikalelectronics.ru Git - kernel.git/commitdiff
fjes: Check for error irq
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 22 Dec 2021 07:12:07 +0000 (15:12 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Dec 2021 10:22:13 +0000 (10:22 +0000)
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: 39f6d73f26bd ("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>
drivers/net/fjes/fjes_main.c

index b06c17ac8d4eedeb8a2903c9e5c9fa73f191b90b..ebd287039a54631aa9a1e2e317a50476dab88315 100644 (file)
@@ -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;