]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitc3ce2164bf0311e7e330d624ef5067aa8d0a8e02
tree2dd76feb11e1e40c613986c6e69805354fd372da
parentbfdcbdd93b8c113dfe81c9d0fb1682bb43bafda5
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