Skip to content

Commit

Permalink
fjes: Check for error irq
Browse files Browse the repository at this point in the history
[ Upstream commit db6d6af ]

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: 658d439 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
JiangJias authored and gregkh committed Dec 29, 2021
1 parent a038c50 commit 643c896
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/fjes/fjes_main.c
Expand Up @@ -1261,6 +1261,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;
Expand Down

0 comments on commit 643c896

Please sign in to comment.