You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
rpmsg: smd: Fix double unlock in __qcom_smd_send()
We're not holding the lock here, so we shouldn't unlock.
Fixes: 178f3f75bb ("rpmsg: smd: Don't hold the tx lock during wait")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[bjorn: renamed "out" label to further distinguish the two exit paths]
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
fb416f6990
commit
c3388a075c
@@ -747,7 +747,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
|||||||
channel->state == SMD_CHANNEL_OPENED) {
|
channel->state == SMD_CHANNEL_OPENED) {
|
||||||
if (!wait) {
|
if (!wait) {
|
||||||
ret = -EAGAIN;
|
ret = -EAGAIN;
|
||||||
goto out;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 0);
|
SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 0);
|
||||||
@@ -759,11 +759,11 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
|||||||
qcom_smd_get_tx_avail(channel) >= tlen ||
|
qcom_smd_get_tx_avail(channel) >= tlen ||
|
||||||
channel->state != SMD_CHANNEL_OPENED);
|
channel->state != SMD_CHANNEL_OPENED);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
return ret;
|
||||||
|
|
||||||
ret = mutex_lock_interruptible(&channel->tx_lock);
|
ret = mutex_lock_interruptible(&channel->tx_lock);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out;
|
return ret;
|
||||||
|
|
||||||
SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
|
SET_TX_CHANNEL_FLAG(channel, fBLOCKREADINTR, 1);
|
||||||
}
|
}
|
||||||
@@ -771,7 +771,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
|||||||
/* Fail if the channel was closed */
|
/* Fail if the channel was closed */
|
||||||
if (channel->state != SMD_CHANNEL_OPENED) {
|
if (channel->state != SMD_CHANNEL_OPENED) {
|
||||||
ret = -EPIPE;
|
ret = -EPIPE;
|
||||||
goto out;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_TX_CHANNEL_FLAG(channel, fTAIL, 0);
|
SET_TX_CHANNEL_FLAG(channel, fTAIL, 0);
|
||||||
@@ -786,7 +786,7 @@ static int __qcom_smd_send(struct qcom_smd_channel *channel, const void *data,
|
|||||||
|
|
||||||
qcom_smd_signal_channel(channel);
|
qcom_smd_signal_channel(channel);
|
||||||
|
|
||||||
out:
|
out_unlock:
|
||||||
mutex_unlock(&channel->tx_lock);
|
mutex_unlock(&channel->tx_lock);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
Reference in New Issue
Block a user