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

Commit 1ac13084 authored by Charan Teja Reddy's avatar Charan Teja Reddy
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 f8b00cea
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -413,11 +413,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: