ion: Add null-pointer check to info structure

Add null-pointer check to info structure to avoid null-pointer
dereference and subsequent kernel crash.

Change-Id: I88135c1efa0b6ddc333e16511016d3618d9d5cf3
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
This commit is contained in:
Olav Haugan 2013-06-26 16:07:30 -07:00 committed by Stephen Boyd
parent bef391ed09
commit fb82188910

View file

@ -139,8 +139,10 @@ static struct page_info *alloc_largest_available(struct ion_system_heap *heap,
continue;
info = kmalloc(sizeof(struct page_info), GFP_KERNEL);
if (info) {
info->page = page;
info->order = orders[i];
}
return info;
}
return NULL;