Jesper Juhl 0169b49d52 UBI: don't use array index before testing if it is negative
I can't find anything guaranteeing that 'ubi_num' cannot be <0 in
drivers/mtd/ubi/kapi.c::ubi_open_volume(), and in fact the code
even tests for that and errors out if so. Unfortunately the test
for "ubi_num < 0" happens after we've already used 'ubi_num' as
an array index - bad thing to do if it is negative.
This patch moves the test earlier in the function and then moves
the indexing using that variable after the check. A bit safer :-)

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2007-10-14 13:10:20 +03:00
..
2007-07-31 15:39:39 -07:00
2007-10-09 12:38:26 -07:00
2007-08-22 19:52:46 -07:00
2007-07-21 18:37:12 -07:00
2007-07-16 09:05:42 -07:00
2007-09-09 10:38:37 -04:00
2007-09-09 22:29:14 +02:00
2007-09-17 00:58:40 -04:00
2007-09-11 17:21:51 +02:00
2007-07-20 14:25:51 +10:00
2007-07-31 15:39:37 -07:00
2007-09-28 16:21:10 -07:00
2007-09-11 17:21:19 -07:00
2007-06-28 19:19:20 +10:00
2007-09-11 17:21:19 -07:00
2007-07-18 08:38:22 -07:00
2007-07-18 15:57:16 -07:00
2007-09-19 11:24:18 -07:00
2007-07-26 11:35:17 -07:00
2007-07-20 13:39:59 +10:00
2007-07-29 18:58:39 +00:00