1
0
Fork 0

rpmsg: glink: Release idr lock before returning on error

The idr_lock should be released in the case that we don't find the given
channel.

Fixes: 44f6df922a ("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>
hifive-unleashed-5.1
Bjorn Andersson 2017-08-30 16:26:23 -07:00
parent 88c6060f5a
commit 5f5423ffa2
1 changed files with 1 additions and 1 deletions

View File

@ -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);