From: Ard Biesheuvel Date: Sun, 30 Nov 2014 12:51:03 +0000 (+0100) Subject: mtd: physmap_of: fix potential NULL dereference X-Git-Tag: omap-for-v3.19/fixes-rc1~56^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92b633a8a482c4bc1ff3b7cffdcace7836861554;p=pandora-kernel.git 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 Signed-off-by: Brian Norris --- Reading git-diff-tree failed