OSDN Git Service

serial: 8250: Do nothing if nr_uarts=0
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 5 May 2015 06:26:27 +0000 (08:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 17:10:07 +0000 (19:10 +0200)
commit59cfc45f17d6d1dda2990e6f5a94df24a18330b8
tree37c05b196a9f91f8c28a9c1a4e585ec5973650e4
parent24ee4df12216a0b1c9a0c22f83fbf366eb216d33
serial: 8250: Do nothing if nr_uarts=0

When nr_uarts was set to 0 (via config or 8250_core.nr_uarts), we crash
early on x86 because serial8250_isa_init_ports dereferences base_ops
which remains NULL. In fact, there is nothing to do for all the callers
of serial8250_isa_init_ports if there are no uarts.

Based on suggestions by Peter Hurley.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_core.c