Ard Biesheuvel 92b633a8a4 mtd: physmap_of: fix potential NULL dereference
On device remove, when testing the cmtd field of an of_flash
struct to decide whether it is a concatenated device or not,
we get a false positive on cmtd == NULL, and dereference it
subsequently. This may occur if of_flash_remove() is called
from the cleanup path of of_flash_probe().

Instead, test for NULL first, and only then perform the test
for a concatenated device.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
2014-12-12 19:12:16 -08:00
..
2014-10-11 11:34:07 -07:00
2014-10-15 07:23:49 +02:00
2014-10-08 17:37:16 -04:00
2014-10-10 22:07:55 -04:00
2014-10-15 07:23:49 +02:00
2014-10-10 16:40:14 -04:00
2014-10-07 21:29:18 -04:00
2014-10-15 06:58:16 +02:00
2014-10-11 06:47:50 -04:00
2014-10-11 20:29:01 -04:00
2014-10-08 17:37:16 -04:00
2014-10-15 07:23:49 +02:00
2014-10-10 16:40:14 -04:00
2014-10-11 20:29:01 -04:00