summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-06 14:33:53 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-06 14:33:53 -0800
commit3dc6ea3f9009ebedc0dce12affa2ece2d9f9d816 (patch)
tree478a786045a9f335f0db1772e55c505af0491d66
parent606a3e1dc09981be1ea697fe6e4596aa0efd6e73 (diff)
parenta1e1a009233289ca64ff387e7a72bd2f59ae0502 (diff)
Merge "soc: qcom: fix to avoid invalid memory access"
-rw-r--r--drivers/soc/qcom/wcd-dsp-glink.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/soc/qcom/wcd-dsp-glink.c b/drivers/soc/qcom/wcd-dsp-glink.c
index 6bc815862541..efd5945ea626 100644
--- a/drivers/soc/qcom/wcd-dsp-glink.c
+++ b/drivers/soc/qcom/wcd-dsp-glink.c
@@ -318,9 +318,6 @@ static void wdsp_glink_notify_state(void *handle, const void *priv,
if (ch->free_mem) {
kfree(ch);
ch = NULL;
- } else {
- /* Open the glink channel again */
- queue_work(wpriv->work_queue, &ch->lcl_ch_open_wrk);
}
} else if (event == GLINK_REMOTE_DISCONNECTED) {
dev_dbg(wpriv->dev, "%s: remote channel: %s disconnected remotely\n",
@@ -607,6 +604,7 @@ static void wdsp_glink_tx_buf_work(struct work_struct *work)
mutex_lock(&tx_buf->ch->mutex);
if (ch->channel_state == GLINK_CONNECTED) {
+ mutex_unlock(&tx_buf->ch->mutex);
ret = glink_tx(ch->handle, tx_buf,
cpkt->payload, cpkt->payload_size,
GLINK_TX_REQ_INTENT);
@@ -621,6 +619,7 @@ static void wdsp_glink_tx_buf_work(struct work_struct *work)
kfree(tx_buf);
}
} else {
+ mutex_unlock(&tx_buf->ch->mutex);
dev_err(wpriv->dev, "%s: channel %s is not in connected state\n",
__func__, ch->ch_cfg.name);
/*
@@ -629,7 +628,6 @@ static void wdsp_glink_tx_buf_work(struct work_struct *work)
*/
kfree(tx_buf);
}
- mutex_unlock(&tx_buf->ch->mutex);
}
/*