[PATCH] mtd: fix null pointer deference when kzalloc returns null

Brian Norris computersforpeace at gmail.com
Tue Aug 18 17:58:51 PDT 2015


On Fri, Jul 17, 2015 at 11:37:52AM +0100, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
> 
> static analysis by smatch caught the following error:
> 
> drivers/mtd/maps/physmap_of.c:135 of_get_probes()
>    error: potential null dereference 'res'.  (kzalloc returns null)
> 
> Check for failed kzalloc and return -ENOMEM in of_flash_probe if
> this occurs.
> 
> Signed-off-by: Colin Ian King <colin.king at canonical.com>

Pushed to l2-mtd.git



More information about the linux-mtd mailing list