[PATCH 4.14 007/135] staging: android: ion: fix sys heap pools gfp_flags

From: Greg Kroah-Hartman
Date: Tue Mar 12 2019 - 13:43:50 EST


4.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Qing Xia <saberlily.xia@xxxxxxxxxxxxx>

commit 9bcf065e28122588a6cbee08cf847826dacbb438 upstream.

In the first loop, gfp_flags will be modified to high_order_gfp_flags,
and there will be no chance to change back to low_order_gfp_flags.

Fixes: e7f63771b60e ("ION: Sys_heap: Add cached pool to spead up cached buffer alloc")
Signed-off-by: Qing Xia <saberlily.xia@xxxxxxxxxxxxx>
Cc: stable <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Jing Xia <jing.xia@xxxxxxxxxx>
Reviewed-by: Yuming Han <yuming.han@xxxxxxxxxx>
Reviewed-by: Zhaoyang Huang <zhaoyang.huang@xxxxxxxxxx>
Reviewed-by: Orson Zhai <orson.zhai@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/staging/android/ion/ion_system_heap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/android/ion/ion_system_heap.c
+++ b/drivers/staging/android/ion/ion_system_heap.c
@@ -298,10 +298,10 @@ static int ion_system_heap_create_pools(
bool cached)
{
int i;
- gfp_t gfp_flags = low_order_gfp_flags;

for (i = 0; i < NUM_ORDERS; i++) {
struct ion_page_pool *pool;
+ gfp_t gfp_flags = low_order_gfp_flags;

if (orders[i] > 4)
gfp_flags = high_order_gfp_flags;