Commit db6d6afe authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by David S. Miller

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: 658d439b ("fjes: Introduce FUJITSU Extended Socket Network Device driver")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1c15b05b
...@@ -1262,6 +1262,11 @@ static int fjes_probe(struct platform_device *plat_dev) ...@@ -1262,6 +1262,11 @@ static int fjes_probe(struct platform_device *plat_dev)
hw->hw_res.start = res->start; hw->hw_res.start = res->start;
hw->hw_res.size = resource_size(res); hw->hw_res.size = resource_size(res);
hw->hw_res.irq = platform_get_irq(plat_dev, 0); 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); err = fjes_hw_init(&adapter->hw);
if (err) if (err)
goto err_free_control_wq; goto err_free_control_wq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment