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

Commit 12b15678 authored by AnilKumar Chimata's avatar AnilKumar Chimata Committed by Gerrit - the friendly Code Review server
Browse files

qseecom: Check error when allocating coherent buffer



Add check to verify whether memory is allocated properly or not
and return error if its failed to allocate coherent buffer.

Change-Id: I234a637d20228d047f6fc11d374b6f13f28fed03
Signed-off-by: default avatarGaurav Kashyap <gaurkash@codeaurora.org>
Signed-off-by: default avatarAnilKumar Chimata <anilc@codeaurora.org>
parent 9c940837
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -4355,6 +4355,11 @@ static int __qseecom_send_modfd_cmd(struct qseecom_dev_handle *data,
	/* Allocate kernel buffer for request and response*/
	ret = __qseecom_alloc_coherent_buf(req.cmd_req_len + req.resp_len,
					&va, &pa);
	if (ret) {
		pr_err("Failed to allocate coherent buf, ret %d\n", ret);
		return ret;
	}

	req.cmd_req_buf = va;
	send_cmd_req.cmd_req_buf = (void *)pa;