Skip to content

Commit c6564c1

Browse files
JiangJiasmarckleinebudde
authored andcommitted
can: xilinx_can: xcan_probe(): check for error irq
For the possible failure of the platform_get_irq(), the returned irq could be error number and will finally cause the failure of the request_irq(). Consider that platform_get_irq() can now in certain cases return -EPROBE_DEFER, and the consequences of letting request_irq() effectively convert that into -EINVAL, even at probe time rather than later on. So it might be better to check just now. Fixes: b1201e4 ("can: xilinx CAN controller support") Link: https://lore.kernel.org/all/[email protected] Signed-off-by: Jiasheng Jiang <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent 370d988 commit c6564c1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/can/xilinx_can.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,12 @@ static int xcan_probe(struct platform_device *pdev)
17611761
spin_lock_init(&priv->tx_lock);
17621762

17631763
/* Get IRQ for the device */
1764-
ndev->irq = platform_get_irq(pdev, 0);
1764+
ret = platform_get_irq(pdev, 0);
1765+
if (ret < 0)
1766+
goto err_free;
1767+
1768+
ndev->irq = ret;
1769+
17651770
ndev->flags |= IFF_ECHO; /* We support local echo */
17661771

17671772
platform_set_drvdata(pdev, ndev);

0 commit comments

Comments
 (0)