Skip to content

Commit

Permalink
drivers: net: smc911x: Check for error irq
Browse files Browse the repository at this point in the history
[ Upstream commit cb93b3e ]

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: ae15043 ("smsc: Move the SMC (SMSC) drivers")
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 643c896 commit 98a5242
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/ethernet/smsc/smc911x.c
Expand Up @@ -2070,6 +2070,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
Expand Down

0 comments on commit 98a5242

Please sign in to comment.