aboutsummaryrefslogtreecommitdiff
path: root/drivers/tty/serial/mxs-auart.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/mxs-auart.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/mxs-auart.c')
-rw-r--r--drivers/tty/serial/mxs-auart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 07390f8c3681..1d9d778828ba 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -1664,6 +1664,10 @@ static int mxs_auart_probe(struct platform_device *pdev)
s->port.line = pdev->id < 0 ? 0 : pdev->id;
else if (ret < 0)
return ret;
+ if (s->port.line >= ARRAY_SIZE(auart_port)) {
+ dev_err(&pdev->dev, "serial%d out of range\n", s->port.line);
+ return -EINVAL;
+ }
if (of_id) {
pdev->id_entry = of_id->data;