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

Commit b5e99bad authored by Charan Teja Reddy's avatar Charan Teja Reddy Committed by Gerrit - the friendly Code Review server
Browse files

ion: don't call free_buffer_page on failure of ion_hyp_unassign_sg



As we don't know the state of pages after failure from
ion_hyp_unassign_sg, don't try to free them to buddy or pool.

Change-Id: I54113ef13e25818301bdbe033468070b15cefa55
Signed-off-by: default avatarCharan Teja Reddy <charante@codeaurora.org>
parent 89086d9c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * drivers/staging/android/ion/ion_system_heap.c
 *
 * Copyright (C) 2011 Google, Inc.
 * Copyright (c) 2011-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2011-2020, 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
@@ -409,11 +409,13 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
	buffer->private_flags |= ION_PRIV_FLAG_SHRINKER_FREE;

	if (vmid > 0)
		ion_hyp_unassign_sg(table, &vmid, 1, true, false);
		if (ion_hyp_unassign_sg(table, &vmid, 1, true, false))
			goto err_free_table_sync;

	for_each_sg(table->sgl, sg, table->nents, i)
		free_buffer_page(sys_heap, buffer, sg_page(sg),
				 get_order(sg->length));
err_free_table_sync:
	if (nents_sync)
		sg_free_table(&table_sync);
err_free_sg: