Skip to content
Commit 7e0c19c9 authored by Colin Ian King's avatar Colin Ian King Committed by Brian Norris
Browse files

mtd: physmap_of: fix null pointer deference when kzalloc returns null



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: default avatarColin Ian King <colin.king@canonical.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 11c7e0e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment