can: xilinx_can: xcan_probe(): check for error irq
[linux-2.6-microblaze.git] / drivers / net / can / xilinx_can.c
index e2b15d2..af4a2ad 100644 (file)
@@ -1761,7 +1761,12 @@ static int xcan_probe(struct platform_device *pdev)
        spin_lock_init(&priv->tx_lock);
 
        /* Get IRQ for the device */
-       ndev->irq = platform_get_irq(pdev, 0);
+       ret = platform_get_irq(pdev, 0);
+       if (ret < 0)
+               goto err_free;
+
+       ndev->irq = ret;
+
        ndev->flags |= IFF_ECHO;        /* We support local echo */
 
        platform_set_drvdata(pdev, ndev);