Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4829e765 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman
Browse files

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: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78506f22
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -883,7 +883,7 @@ auart_console_write(struct console *co, const char *str, unsigned int count)
	unsigned int old_ctrl0, old_ctrl2;
	unsigned int old_ctrl0, old_ctrl2;
	unsigned int to = 1000;
	unsigned int to = 1000;


	if (co->index >	MXS_AUART_PORTS || co->index < 0)
	if (co->index >= MXS_AUART_PORTS || co->index < 0)
		return;
		return;


	s = auart_port[co->index];
	s = auart_port[co->index];