Skip to content

Commit bb8478d

Browse files
AxelLingregkh
authored andcommitted
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>
1 parent 1d267ea commit bb8478d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/tty/serial/ar933x_uart.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ static int ar933x_uart_probe(struct platform_device *pdev)
649649
id = 0;
650650
}
651651

652-
if (id > CONFIG_SERIAL_AR933X_NR_UARTS)
652+
if (id >= CONFIG_SERIAL_AR933X_NR_UARTS)
653653
return -EINVAL;
654654

655655
irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

0 commit comments

Comments
 (0)