serial: icom: move array overflow checks earlier
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 26 Aug 2013 15:10:01 +0000 (18:10 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Aug 2013 23:24:33 +0000 (16:24 -0700)
commit4f03ffcd3e8a8860c9adc153f03bf2ed7d428f2b
treed4d5080175aed0b0d7c8dd30c5c74593f0e65d8a
parent1b2a405bbacc513627be875515bff4af5b498346
serial: icom: move array overflow checks earlier

This code does an annoying thing where it writes to the array and then
checks later for array overflows.  I don't know if it's actually
possible to overflow but let's check before using the array index.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/icom.c