summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/fsl_lpuart.c
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2018-06-21 09:58:24 +0200
committerMax Krummenacher <max.krummenacher@toradex.com>2018-06-21 09:58:24 +0200
commit47133a000cd65fc17873e562e2f72b368b615760 (patch)
treeedcd6be8a1d66c7b440af54700eaf807333c690a /drivers/tty/serial/fsl_lpuart.c
parent6fb9f3c8a4992f67dcb3ce413df2e22e96b2d400 (diff)
parent0bd2bedb3501db249b347e5acbfd3415bd7667a5 (diff)
Merge tag 'v4.4.138' into toradex_vf_4.4-next
This is the 4.4.138 stable release
Diffstat (limited to 'drivers/tty/serial/fsl_lpuart.c')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index b94a4d7b4849..96ba3a2a9e37 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -2007,6 +2007,10 @@ static int lpuart_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
return ret;
}
+ if (ret >= ARRAY_SIZE(lpuart_ports)) {
+ dev_err(&pdev->dev, "serial%d out of range\n", ret);
+ return -EINVAL;
+ }
sport->port.line = ret;
sport->lpuart32 = of_device_is_compatible(np, "fsl,ls1021a-lpuart");