Skip to content

Commit

Permalink
rpmsg: glink: Release idr lock before returning on error
Browse files Browse the repository at this point in the history
The idr_lock should be released in the case that we don't find the given
channel.

Fixes: 44f6df9 ("rpmsg: glink: Fix idr_lock from mutex to spinlock")
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
  • Loading branch information
Bjorn Andersson committed Aug 30, 2017
1 parent 88c6060 commit 5f5423f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rpmsg/qcom_glink_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,11 +938,11 @@ static int qcom_glink_rx_open_ack(struct qcom_glink *glink, unsigned int lcid)

spin_lock(&glink->idr_lock);
channel = idr_find(&glink->lcids, lcid);
spin_unlock(&glink->idr_lock);
if (!channel) {
dev_err(glink->dev, "Invalid open ack packet\n");
return -EINVAL;
}
spin_unlock(&glink->idr_lock);

complete(&channel->open_ack);

Expand Down

0 comments on commit 5f5423f

Please sign in to comment.