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: NColin Ian King <colin.king@canonical.com> Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
Showing
想要评论请 注册 或 登录