diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-06-30 17:41:22 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-06-30 17:41:22 -0400 |
commit | 44454bcdb90532b372c74e3546043d8a3a468939 (patch) | |
tree | 823fa555fe7c419c4cbc0616fff5b6dadd4d81fa /drivers/serial | |
parent | 9b4311eedb17fa88f02e4876cd6aa9a08e383cd6 (diff) |
[PATCH] Serial: Fix small CONFIG_SERIAL_8250_NR_UARTS
If CONFIG_SERIAL_8250_NR_UARTS is smaller than the array size in
asm/serial.h, we trampled on memory which wasn't ours. Take our
big boots away by limiting the number of ports initialised to the
smaller of ...NR_UARTS and the array size.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 9224fc3184ea..7e8fc7c1d4cc 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -2061,7 +2061,8 @@ static void __init serial8250_isa_init_ports(void) | |||
2061 | up->port.ops = &serial8250_pops; | 2061 | up->port.ops = &serial8250_pops; |
2062 | } | 2062 | } |
2063 | 2063 | ||
2064 | for (i = 0, up = serial8250_ports; i < ARRAY_SIZE(old_serial_port); | 2064 | for (i = 0, up = serial8250_ports; |
2065 | i < ARRAY_SIZE(old_serial_port) && i < UART_NR; | ||
2065 | i++, up++) { | 2066 | i++, up++) { |
2066 | up->port.iobase = old_serial_port[i].port; | 2067 | up->port.iobase = old_serial_port[i].port; |
2067 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); | 2068 | up->port.irq = irq_canonicalize(old_serial_port[i].irq); |