android_kernel_xiaomi_sdm845/drivers/mtd/ubi
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
..
build.c UBI: remove unneeded error checks 2007-07-18 16:58:53 +03:00
cdev.c UBI: fix compile warning 2007-07-18 16:59:17 +03:00
debug.c UBI: bugfix in error path 2007-07-18 16:55:55 +03:00
debug.h UBI: bugfix in error path 2007-07-18 16:55:55 +03:00
eba.c mm: Remove slab destructors from kmem_cache_create(). 2007-07-20 10:11:58 +09:00
gluebi.c UBI: set correct gluebi device size 2007-07-18 16:52:51 +03:00
io.c UBI: add more prints 2007-10-14 13:10:20 +03:00
kapi.c UBI: don't use array index before testing if it is negative 2007-10-14 13:10:20 +03:00
Kconfig UBI: Unsorted Block Images 2007-04-27 14:23:33 +03:00
Kconfig.debug UBI: Unsorted Block Images 2007-04-27 14:23:33 +03:00
Makefile UBI: Unsorted Block Images 2007-04-27 14:23:33 +03:00
misc.c UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
scan.c UBI: fix sparse warnings 2007-10-14 13:10:20 +03:00
scan.h UBI: fix error path in create_vtbl() 2007-07-18 16:52:32 +03:00
ubi.h UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
upd.c UBI: use vmalloc for large buffers 2007-07-18 16:53:08 +03:00
vmt.c UBI: fix sparse warnings 2007-10-14 13:10:20 +03:00
vtbl.c UBI: fix overflow bug 2007-07-18 16:58:12 +03:00
wl.c UBI: add more prints 2007-10-14 13:10:20 +03:00