diff --git a/drivers/gpu/ion/ion_system_heap.c b/drivers/gpu/ion/ion_system_heap.c index 2bab7c4eb375..44bb86fb3682 100644 --- a/drivers/gpu/ion/ion_system_heap.c +++ b/drivers/gpu/ion/ion_system_heap.c @@ -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); - info->page = page; - info->order = orders[i]; + if (info) { + info->page = page; + info->order = orders[i]; + } return info; } return NULL;