summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiasheng Jiang <jiasheng@iscas.ac.cn>2021-12-22 10:41:12 +0300
committerDavid S. Miller <davem@davemloft.net>2021-12-22 13:23:03 +0300
commitcb93b3e11d405f20a405a07482d01147ef4934a3 (patch)
tree56f83f34ec880697af2c7cfd0b3c910b4789abe3
parentdb6d6afe382de5a65d6ccf51253ab48b8e8336c3 (diff)
downloadlinux-cb93b3e11d405f20a405a07482d01147ef4934a3.tar.xz
drivers: net: smc911x: 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: ae150435b59e ("smsc: Move the SMC (SMSC) drivers") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/smsc/smc911x.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 89381f796985..dd6f69ced4ee 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -2072,6 +2072,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
ndev->dma = (unsigned char)-1;
ndev->irq = platform_get_irq(pdev, 0);
+ if (ndev->irq < 0) {
+ ret = ndev->irq;
+ goto release_both;
+ }
+
lp = netdev_priv(ndev);
lp->netdev = ndev;
#ifdef SMC_DYNAMIC_BUS_CONFIG