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 a141cf018b
commit 9ac08a7ad7

View File

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