summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/ar933x_uart.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2015-02-23 11:34:30 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-07 03:20:25 +0100
commitbb8478d7d676802211a9a5d77bd0f87899900e41 (patch)
tree33033fb00619d165fa2e9f9463b50fab172b8c1c /drivers/tty/serial/ar933x_uart.c
parent1d267ea6539f266352f4739c718e278dc62b1df7 (diff)
downloadlinux-bb8478d7d676802211a9a5d77bd0f87899900e41.tar.bz2
serial: ar933x_uart: Fix off-by-one for checking valid alias id
Current code uses the alias id as array subscript of ar933x_console_ports. So the valid id is 0 ... CONFIG_SERIAL_AR933X_NR_UARTS - 1. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/ar933x_uart.c')
-rw-r--r--drivers/tty/serial/ar933x_uart.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 77fc9faa74a4..1519d2ca7705 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -649,7 +649,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
id = 0;
}
- if (id > CONFIG_SERIAL_AR933X_NR_UARTS)
+ if (id >= CONFIG_SERIAL_AR933X_NR_UARTS)
return -EINVAL;
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);