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

Commit 2cc23e8e authored by Vinayak Menon's avatar Vinayak Menon
Browse files

drivers: staging: ion: fix error check in check_valid_vmid



check_valid_vmid makes an incorrect assumption on the return
value of ion_msm_page_pool_alloc causing an incorrect pointer
access later in ion_msm_page_pool_add.

Change-Id: I45dc78978385498366ba729b447ec365a31474d8
Fixes: cae595f4 ("ion: Check for valid vmids for msm system heap")
Signed-off-by: default avatarVinayak Menon <vinmenon@codeaurora.org>
parent 2c8ec678
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -3,7 +3,7 @@
 * ION Memory Allocator system heap exporter
 * ION Memory Allocator system heap exporter
 *
 *
 * Copyright (C) 2011 Google, Inc.
 * Copyright (C) 2011 Google, Inc.
 * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2021, The Linux Foundation. All rights reserved.
 *
 *
 */
 */


@@ -291,7 +291,7 @@ static bool check_valid_vmid(int dest_vmid, struct ion_msm_system_heap *sys_heap


	page = ion_msm_page_pool_alloc(sys_heap->uncached_pools[order_ind],
	page = ion_msm_page_pool_alloc(sys_heap->uncached_pools[order_ind],
				       &from_pool);
				       &from_pool);
	if (!page)
	if (IS_ERR(page))
		return false;
		return false;


	if (!from_pool)
	if (!from_pool)