Skip to content

Commit

Permalink
net: ks8851: Check for error irq
Browse files Browse the repository at this point in the history
[ Upstream commit 99d7fbb ]

Because platform_get_irq() could fail and return error irq.
Therefore, it might be better to check it if order to avoid the use of
error irq.

Fixes: 797047f ("net: ks8851: Implement Parallel bus operations")
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 9db0f8d commit 75c962f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/micrel/ks8851_par.c
Expand Up @@ -323,6 +323,8 @@ static int ks8851_probe_par(struct platform_device *pdev)
return ret;

netdev->irq = platform_get_irq(pdev, 0);
if (netdev->irq < 0)
return netdev->irq;

return ks8851_probe_common(netdev, dev, msg_enable);
}
Expand Down

0 comments on commit 75c962f

Please sign in to comment.