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

Verified Commit 3b7b835e authored by android-t1's avatar android-t1 Committed by Ahmed Harhash
Browse files

Integrate security patch 2023-05-05-CVE-2023-21666

Change-Id: Ic1d3ed9d6e9e221a4167103869d9171843841705
parent 4ab1f164
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
 */

#include <asm/cacheflush.h>
@@ -61,6 +62,15 @@ _kgsl_get_pool_from_order(unsigned int order)
static void
_kgsl_pool_add_page(struct kgsl_page_pool *pool, struct page *p)
{
	/*
	 * Sanity check to make sure we don't re-pool a page that
	 * somebody else has a reference to.
	 */
	if (WARN_ON_ONCE(unlikely(page_count(p) > 1))) {
		__free_pages(p, pool->pool_order);
		return;
	}

	kgsl_zero_page(p, pool->pool_order);

	spin_lock(&pool->list_lock);