diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2017-03-24 12:12:55 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-03-24 12:12:54 -0700 |
commit | bf4ee749a7642ef603079156b4e92aeacbd613be (patch) | |
tree | 5f724606f160516bc5ee4d7f10ce1f223f92811b /drivers | |
parent | 6ec5aba99c82654eb54d113598578fd6d97ca7b9 (diff) | |
parent | aadb9ac89c8fb8c29f41ea24a22c1ce5ac9bfc16 (diff) |
Merge "ion: ion_system_heap: Fix null pointer dereference"
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/android/ion/ion_system_heap.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index 03b2b8a38991..2ad4cc7a4785 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -2,7 +2,7 @@ * drivers/staging/android/ion/ion_system_heap.c * * Copyright (C) 2011 Google, Inc. - * Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. + * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -123,9 +123,11 @@ static struct page *alloc_buffer_page(struct ion_system_heap *heap, gfp_t gfp_mask = low_order_gfp_flags; if (order) gfp_mask = high_order_gfp_flags; + page = alloc_pages(gfp_mask, order); - ion_pages_sync_for_device(dev, page, PAGE_SIZE << order, - DMA_BIDIRECTIONAL); + if (page) + ion_pages_sync_for_device(dev, page, PAGE_SIZE << order, + DMA_BIDIRECTIONAL); } if (!page) return 0; |