aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/samsung.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-06-01 11:40:46 +0100
committerMark Brown <broonie@kernel.org>2018-06-01 11:40:46 +0100
commit1e82572e5f806782cc1bf06e6d22905c28b0a9f5 (patch)
treec428a640fca2ee5c6bfe259482b941f5e0ece927 /drivers/tty/serial/samsung.c
parent29e8549d35499289ce6211a553f956a2ab9a3905 (diff)
parent86a04ba0955e3c806ed301cf178f1e130f1cb785 (diff)
Merge branch 'linux-linaro-lsk-v4.9' into linux-linaro-lsk-v4.9-rtlsk-v4.9-18.05-rt
Diffstat (limited to 'drivers/tty/serial/samsung.c')
-rw-r--r--drivers/tty/serial/samsung.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c
index d65f92bcd0f1..f2ab6d8aab41 100644
--- a/drivers/tty/serial/samsung.c
+++ b/drivers/tty/serial/samsung.c
@@ -1813,6 +1813,10 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
dbg("s3c24xx_serial_probe(%p) %d\n", pdev, index);
+ if (index >= ARRAY_SIZE(s3c24xx_serial_ports)) {
+ dev_err(&pdev->dev, "serial%d out of range\n", index);
+ return -EINVAL;
+ }
ourport = &s3c24xx_serial_ports[index];
ourport->drv_data = s3c24xx_get_driver_data(pdev);