Commit b9cbe7e8 authored by Tony Lindgren's avatar Tony Lindgren Committed by Greg Kroah-Hartman
Browse files

serial: 8250: Check for valid console index



Let's not allow negative numbers for console index.

Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231004085511.42645-1-tony@atomide.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0d447e92
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -611,7 +611,7 @@ static int univ8250_console_setup(struct console *co, char *options)
	 * if so, search for the first available port that does have
	 * console support.
	 */
	if (co->index >= UART_NR)
	if (co->index < 0 || co->index >= UART_NR)
		co->index = 0;

	/*