[PATCH] mtd: physmap_of: fix potential NULL dereference
Brian Norris
computersforpeace at gmail.com
Fri Dec 12 19:28:24 PST 2014
On Sun, Nov 30, 2014 at 01:51:03PM +0100, Ard Biesheuvel wrote:
> 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 at linaro.org>
Applied to l2-mtd.git. Thanks!
Brian
More information about the linux-mtd
mailing list