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

Commit 010a0cd6 authored by Youssef Youssef's avatar Youssef Youssef Committed by Gerrit - the friendly Code Review server
Browse files

scm_qcpe: validate hab_recv() return value for retry



habmm_socket_recv() can return -EINTR which indicate that
the operation must be restarted.

Change-Id: I0860a9593303c7bf1fea5e0349595c4b2fb085eb
Signed-off-by: default avatarYoussef Youssef <yyoussef@codeaurora.org>
parent 9e66b661
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -473,11 +473,15 @@ static int scm_call_qcpe(u32 fn_id, struct scm_desc *desc)
		goto err_ret;
	}

	size_bytes = sizeof(smc_params);

	memset(&smc_params, 0x0, sizeof(smc_params));

	do {
		size_bytes = sizeof(smc_params);
		ret = habmm_socket_recv(handle, &smc_params, &size_bytes, 0,
			HABMM_SOCKET_RECV_FLAGS_UNINTERRUPTIBLE);
	} while (-EINTR == ret);

	if (ret) {
		pr_err("habmm_socket_recv failed, ret= 0x%x\n", ret);
		goto err_ret;