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);
7 +static struct omap_uart_state statebuf[4];
9 static int __init omap_serial_early_init(void)
12 @@ -272,9 +274,9 @@ static int __init omap_serial_early_init
16 - uart = kzalloc(sizeof(struct omap_uart_state), GFP_KERNEL);
18 + if (WARN_ON(num_uarts >= ARRAY_SIZE(statebuf)))
20 + uart = &statebuf[num_uarts];
23 uart->num = num_uarts++;