Skip to content

Commit

Permalink
rpmsg: glink: Unlock on error in qcom_glink_request_intent()
Browse files Browse the repository at this point in the history
If qcom_glink_tx() fails, then we need to unlock before returning the
error code.

Fixes: 27b9c5b ("rpmsg: glink: Request for intents when unavailable")
Acked-by: Sricharan R <sricharan@codeaurora.org>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Dan Carpenter authored and Bjorn Andersson committed Oct 10, 2017
1 parent 2bd6bf0 commit 0a7480b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rpmsg/qcom_glink_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink,

ret = qcom_glink_tx(glink, &cmd, sizeof(cmd), NULL, 0, true);
if (ret)
return ret;
goto unlock;

ret = wait_for_completion_timeout(&channel->intent_req_comp, 10 * HZ);
if (!ret) {
Expand All @@ -1207,6 +1207,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink,
ret = channel->intent_req_result ? 0 : -ECANCELED;
}

unlock:
mutex_unlock(&channel->intent_req_lock);
return ret;
}
Expand Down

0 comments on commit 0a7480b

Please sign in to comment.