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

Commit dbe59ab3 authored by Isaac J. Manjarres's avatar Isaac J. Manjarres
Browse files

soc: qcom: mem-buf: Do not free memory if hyp_assign() fails



The state of memory--with respect to access control--is unknown
when a hyp_assign() call fails because the underlying SCM call
fails. In these cases, it is not safe to access the memory, so
we should not free it back to the system.

Change-Id: I992225cdd5f26fbba60d2966d051d026326cd593
Signed-off-by: default avatarIsaac J. Manjarres <isaacm@codeaurora.org>
parent 8340c9f9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -619,6 +619,7 @@ static struct mem_buf_xfer_mem *mem_buf_process_alloc_req(void *req)
	if (!xfer_mem->secure_alloc && (mem_buf_unassign_mem(xfer_mem) < 0))
		return ERR_PTR(ret);
err_assign_mem:
	if (ret != -EADDRNOTAVAIL)
		mem_buf_rmt_free_mem(xfer_mem);
err_rmt_alloc:
	mem_buf_free_xfer_mem(xfer_mem);