提交 bb8478d7 编写于 作者: A Axel Lin 提交者: Greg Kroah-Hartman

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: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 1d267ea6
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册