Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af5304a3 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Fix the access to invalid pool"

parents 603ba32c 22fed856
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -331,9 +331,10 @@ int kgsl_pool_alloc_page(int *page_size, struct page **pages,
		return -EINVAL;

	pool = _kgsl_get_pool_from_order(order);
	pool_idx = kgsl_pool_idx_lookup(order);
	if (pool == NULL)
		return -EINVAL;

	if (pool != NULL)
	pool_idx = kgsl_pool_idx_lookup(order);
	page = _kgsl_pool_get_page(pool);

	/* Allocate a new page if not allocated from pool */
@@ -341,7 +342,7 @@ int kgsl_pool_alloc_page(int *page_size, struct page **pages,
		gfp_t gfp_mask = kgsl_gfp_mask(order);

		/* Only allocate non-reserved memory for certain pools */
		if (!pool->allocation_allowed) {
		if (!pool->allocation_allowed && pool_idx > 0) {
			*page_size = PAGE_SIZE <<
					kgsl_pools[pool_idx-1].pool_order;
			*align = ilog2(*page_size);