mtd: ubi: avoid NULL pointer dereference in ubi_get_device
If the ubidetach command is given a number that passes the range check
in ubi_detach_mtd_dev, but at which index the ubi_devices array contains
a NULL pointer, ubi_get_device tries to dereference this NULL pointer
to increment the ubi device reference count.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent d10caff commit 4449fac89875a8fffeaab00edad0e759db81a329
@Philipp Zabel Philipp Zabel authored on 19 Mar 2014
Sascha Hauer committed on 23 Mar 2014
Showing 1 changed file
View
drivers/mtd/ubi/build.c