serial: 8250: Don't crash when nr_uarts is 0

This commit is contained in:
Phil Elwell
2015-06-30 14:12:42 +01:00
committed by popcornmix
parent a0651b3078
commit de2fd5604c

View File

@@ -509,6 +509,8 @@ static void __init serial8250_isa_init_ports(void)
if (nr_uarts > UART_NR) if (nr_uarts > UART_NR)
nr_uarts = UART_NR; nr_uarts = UART_NR;
if (!nr_uarts)
return;
for (i = 0; i < nr_uarts; i++) { for (i = 0; i < nr_uarts; i++) {
struct uart_8250_port *up = &serial8250_ports[i]; struct uart_8250_port *up = &serial8250_ports[i];