projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0d447e9
)
serial: 8250: Check for valid console index
author
Tony Lindgren
<tony@atomide.com>
Wed, 4 Oct 2023 08:55:10 +0000
(11:55 +0300)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 5 Oct 2023 07:41:17 +0000
(09:41 +0200)
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>
drivers/tty/serial/8250/8250_core.c
patch
|
blob
|
history
diff --git
a/drivers/tty/serial/8250/8250_core.c
b/drivers/tty/serial/8250/8250_core.c
index 904e319e6b4a3576eca555af04e0c1fac91a7d35..912733151858760bdab550be2bd261db296f68d3 100644
(file)
--- a/
drivers/tty/serial/8250/8250_core.c
+++ b/
drivers/tty/serial/8250/8250_core.c
@@
-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;
/*