diff mbox

rpmsg: smd: Fix double unlock in __qcom_smd_send()

Message ID 20180119132236.GA32641@mwanda (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Dan Carpenter Jan. 19, 2018, 1:22 p.m. UTC
We're not holding the lock here, so we shouldn't unlock.

Fixes: 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bjorn Andersson Jan. 19, 2018, 3:08 p.m. UTC | #1
On Fri 19 Jan 05:22 PST 2018, Dan Carpenter wrote:

> We're not holding the lock here, so we shouldn't unlock.
> 
> Fixes: 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 

Thanks Dan!

Regards,
Bjorn

> diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
> index cea9a0930c4d..dd3e7eea8c38 100644
> --- a/drivers/rpmsg/qcom_smd.c
> +++ b/drivers/rpmsg/qcom_smd.c
> @@ -759,11 +759,11 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
>  				       qcom_smd_get_tx_avail(channel) >= tlen ||
>  				       channel->state != SMD_CHANNEL_OPENED);
>  		if (ret)
> -			goto out;
> +			goto ret;
>  
>  		ret = mutex_lock_interruptible(&channel->tx_lock);
>  		if (ret)
> -			goto out;
> +			return ret;
>  
>  		SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
>  	}
--
To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/rpmsg/qcom_smd.c b/drivers/rpmsg/qcom_smd.c
index cea9a0930c4d..dd3e7eea8c38 100644
--- a/drivers/rpmsg/qcom_smd.c
+++ b/drivers/rpmsg/qcom_smd.c
@@ -759,11 +759,11 @@  static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
 				       qcom_smd_get_tx_avail(channel) >= tlen ||
 				       channel->state != SMD_CHANNEL_OPENED);
 		if (ret)
-			goto out;
+			goto ret;
 
 		ret = mutex_lock_interruptible(&channel->tx_lock);
 		if (ret)
-			goto out;
+			return ret;
 
 		SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
 	}