serial/arc-uart: Don't index with -ve platform_device->id
authorVineet Gupta <Vineet.Gupta1@synopsys.com>
Fri, 11 Jan 2013 06:20:20 +0000 (11:50 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2013 06:15:17 +0000 (22:15 -0800)
commit026bb292c4018dd77186dee1fcb73c9067e69b89
tree2dd76feb11e1e40c613986c6e69805354fd372da
parente9ea096dd2259454e0d09d0b0445fe8f0117add4
serial/arc-uart: Don't index with -ve platform_device->id

probe routine could index into port[] with -ve index. The check in
arc_uart_init_one() was too late.

This came to light when trying to port driver to CONFIG_OF, where
bydefault of-core code sets -ve platform dev id and in absence of
DT serial aliases, driver would use the -ve index.

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/arc_uart.c