diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2021-12-22 10:59:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-12-22 13:23:50 +0300 |
commit | 99d7fbb5cedf598f67e8be106d6c7b8d91366aef (patch) | |
tree | f724be5f303002b0cde42ab84ccae580a2a75f48 /drivers/net/ethernet/micrel | |
parent | cb93b3e11d405f20a405a07482d01147ef4934a3 (diff) | |
download | linux-99d7fbb5cedf598f67e8be106d6c7b8d91366aef.tar.xz |
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: 797047f875b5 ("net: ks8851: Implement Parallel bus operations")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/micrel')
-rw-r--r-- | drivers/net/ethernet/micrel/ks8851_par.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/micrel/ks8851_par.c b/drivers/net/ethernet/micrel/ks8851_par.c index 2e25798c610e..7f49042484bd 100644 --- a/drivers/net/ethernet/micrel/ks8851_par.c +++ b/drivers/net/ethernet/micrel/ks8851_par.c @@ -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); } |