Skip to contentSkip to conversation

rpmsg: smd: Fix double unlock in __qcom_smd_send()

PATCH In review Dan Carpenter 2 participants 2 messages Jan 19, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rpmsg: smd: Fix double unlock in __qcom_smd_send()

We're not holding the lock here, so we shouldn't unlock.

Fixes 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait")
drivers/rpmsg/qcom_smd.c +2 -2
index cea9a0930c4d..dd3e7eea8c38 100644
@@ -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);
 	}
#1 lore raw
Quoted 5 lines · Dan Carpenter

We're not holding the lock here, so we shouldn't unlock.

Fixes 178f3f75bb4e ("rpmsg: smd: Don't hold the tx lock during wait")

Thanks Dan!

Regards,
Bjorn

Quoted 18 lines
drivers/rpmsg/qcom_smd.c +2 -2
index cea9a0930c4d..dd3e7eea8c38 100644
@@ -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);
 	}