提交 4829e765 编写于 作者: W Wolfram Sang 提交者: Greg Kroah-Hartman

serial: mxs: fix buffer overflow

SMATCH correctly found an off-by-one error:

drivers/tty/serial/mxs-auart.c:889 auart_console_write() error: buffer overflow 'auart_port' 5 <= 5
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 78506f22
......@@ -883,7 +883,7 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
unsigned int old_ctrl0, old_ctrl2;
unsigned int to = 1000;
if (co->index > MXS_AUART_PORTS || co->index < 0)
if (co->index >= MXS_AUART_PORTS || co->index < 0)
return;
s = auart_port[co->index];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册