mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 15:13:44 -04: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:
committed by
Greg Kroah-Hartman
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;
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user