mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 15:41:36 +00:00
serial: 8250: Check for valid console index
Let's not allow negative numbers for console index. Signed-off-by: Tony Lindgren <tony@atomide.com> Link: https://lore.kernel.org/r/20231004085511.42645-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0d447e927e
commit
b9cbe7e8f2
@ -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;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user