| 1 | --- a/arch/arm/mach-omap2/serial.c |
| 2 | +++ b/arch/arm/mach-omap2/serial.c |
| 3 | @@ -258,6 +258,8 @@ char *cmdline_find_option(char *str) |
| 4 | return strstr(saved_command_line, str); |
| 5 | } |
| 6 | |
| 7 | +static struct omap_uart_state statebuf[4]; |
| 8 | + |
| 9 | static int __init omap_serial_early_init(void) |
| 10 | { |
| 11 | do { |
| 12 | @@ -272,9 +274,9 @@ static int __init omap_serial_early_init |
| 13 | if (!oh) |
| 14 | break; |
| 15 | |
| 16 | - uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL); |
| 17 | - if (WARN_ON(!uart)) |
| 18 | + if (WARN_ON(num_uarts >= ARRAY_SIZE(statebuf))) |
| 19 | return -ENODEV; |
| 20 | + uart = &statebuf[num_uarts]; |
| 21 | |
| 22 | uart->oh = oh; |
| 23 | uart->num = num_uarts++; |
| 24 | |