提交 27dd2e04 编写于 作者: T Tony Prisk 提交者: Greg Kroah-Hartman

serial: vt8500: Fix range-checking on vt8500_uart_ports

Fix two instances where the index to vt8500_uart_ports is tested
against > VT8500_MAX_PORTS. Correct usage should be >= VT8500_MAX_PORTS.
Signed-off-by: NTony Prisk <linux@prisktech.co.nz>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 f938f378
......@@ -560,7 +560,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
if (np)
port = of_alias_get_id(np, "serial");
if (port > VT8500_MAX_PORTS)
if (port >= VT8500_MAX_PORTS)
port = -1;
else
port = -1;
......@@ -571,7 +571,7 @@ static int vt8500_serial_probe(struct platform_device *pdev)
sizeof(vt8500_ports_in_use));
}
if (port > VT8500_MAX_PORTS)
if (port >= VT8500_MAX_PORTS)
return -ENODEV;
/* reserve the port id */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册