Commit cb93b3e1 authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by David S. Miller

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: ae150435 ("smsc: Move the SMC (SMSC) drivers")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent db6d6afe
...@@ -2072,6 +2072,11 @@ static int smc911x_drv_probe(struct platform_device *pdev) ...@@ -2072,6 +2072,11 @@ static int smc911x_drv_probe(struct platform_device *pdev)
ndev->dma = (unsigned char)-1; ndev->dma = (unsigned char)-1;
ndev->irq = platform_get_irq(pdev, 0); ndev->irq = platform_get_irq(pdev, 0);
if (ndev->irq < 0) {
ret = ndev->irq;
goto release_both;
}
lp = netdev_priv(ndev); lp = netdev_priv(ndev);
lp->netdev = ndev; lp->netdev = ndev;
#ifdef SMC_DYNAMIC_BUS_CONFIG #ifdef SMC_DYNAMIC_BUS_CONFIG
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment