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: Charan Teja Reddy <charante@codeaurora.org>
[isaacm@codeaurora.org: resolved trivial merge conflicts]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
This commit is contained in:
Charan Teja Reddy 2020-02-13 13:51:41 +05:30 • committed by Isaac J. Manjarres
commit c801746d9c

View file

@ -390,11 +390,13 @@ err_free_sg2:
buffer->private_flags |= ION_PRIV_FLAG_SHRINKER_FREE;
if (vmid > 0)
ion_hyp_unassign_sg(table, &vmid, 1, true);
if (ion_hyp_unassign_sg(table, &vmid, 1, true))
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: