From 5f5423ffa223a0beb755563beac67f741662870b Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Wed, 30 Aug 2017 16:26:23 -0700 Subject: 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: 44f6df922a26 ("rpmsg: glink: Fix idr_lock from mutex to spinlock") Reported-by: Julia Lawall Signed-off-by: Bjorn Andersson --- drivers/rpmsg/qcom_glink_native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/rpmsg') diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_native.c index 4faee2d17728..0982dee50291 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -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); -- cgit v1.2.3