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: Youssef Youssef <yyoussef@codeaurora.org>
This commit is contained in:
Youssef Youssef 2018-11-28 18:25:34 +02:00 committed by Gerrit - the friendly Code Review server
parent 9e66b661ec
commit 010a0cd6a6

View file

@ -473,11 +473,15 @@ static int scm_call_qcpe(u32 fn_id, struct scm_desc *desc)
goto err_ret; goto err_ret;
} }
size_bytes = sizeof(smc_params);
memset(&smc_params, 0x0, 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, ret = habmm_socket_recv(handle, &smc_params, &size_bytes, 0,
HABMM_SOCKET_RECV_FLAGS_UNINTERRUPTIBLE); HABMM_SOCKET_RECV_FLAGS_UNINTERRUPTIBLE);
} while (-EINTR == ret);
if (ret) { if (ret) {
pr_err("habmm_socket_recv failed, ret= 0x%x\n", ret); pr_err("habmm_socket_recv failed, ret= 0x%x\n", ret);
goto err_ret; goto err_ret;