mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-11-07 04:09:21 +00:00
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:
parent
bef391ed09
commit
fb82188910
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue