summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnson Huang <Anson.Huang@nxp.com>2020-05-11 15:09:56 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-15 12:25:15 +0200
commitaa49d8e8b2dfc112f7de9c58698ae06b2101c73c (patch)
treea9e3018bdeea958a967fc6d21f5a7c16e4ace498
parent24637007394e85737ff1798fcd0f62f1fd7dc6af (diff)
tty: serial: imx: Add return value check for platform_get_irq()
RX irq is required, so add return value check for platform_get_irq(). Signed-off-by: Anson Huang <Anson.Huang@nxp.com> Link: https://lore.kernel.org/r/1589180996-618-1-git-send-email-Anson.Huang@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index f4d68109bc8b..f4023d9d8e7a 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2252,6 +2252,8 @@ static int imx_uart_probe(struct platform_device *pdev)
return PTR_ERR(base);
rxirq = platform_get_irq(pdev, 0);
+ if (rxirq < 0)
+ return rxirq;
txirq = platform_get_irq_optional(pdev, 1);
rtsirq = platform_get_irq_optional(pdev, 2);