serial: mxs-auart: Check for platform_get_irq() error
authorFabio Estevam <fabio.estevam@freescale.com>
Wed, 14 Jan 2015 16:39:08 +0000 (14:39 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 2 Feb 2015 18:11:25 +0000 (10:11 -0800)
We should check whether platform_get_irq() failed, and in the case of error
this needs to be propagated.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mxs-auart.c

index 767fdda..b54b6a2 100644 (file)
@@ -1265,6 +1265,9 @@ static int mxs_auart_probe(struct platform_device *pdev)
        s->mctrl_prev = 0;
 
        irq = platform_get_irq(pdev, 0);
+       if (irq < 0)
+               return irq;
+
        s->port.irq = irq;
        ret = devm_request_irq(&pdev->dev, irq, mxs_auart_irq_handle, 0,
                               dev_name(&pdev->dev), s);