提交 db6d6afe 编写于 作者: J Jiasheng Jiang 提交者: 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: NJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 1c15b05b
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册