net: ks8851: Check for error irq

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: 797047f875 ("net: ks8851: Implement Parallel bus operations")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiasheng Jiang 2021-12-22 15:59:44 +08:00 committed by David S. Miller
parent cb93b3e11d
commit 99d7fbb5ce

View File

@ -321,6 +321,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);
}