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

Commit 5f5423ff authored by Bjorn Andersson's avatar Bjorn Andersson
Browse files

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: 44f6df92 ("rpmsg: glink: Fix idr_lock from mutex to spinlock")
Reported-by: default avatarJulia Lawall <julia.lawall@lip6.fr>
Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
parent 88c6060f
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -938,11 +938,11 @@ static int qcom_glink_rx_open_ack(struct qcom_glink *glink, unsigned int lcid)


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


	complete(&channel->open_ack);
	complete(&channel->open_ack);