Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a66f2382 authored by Nagaradhesh Yeleswarapu's avatar Nagaradhesh Yeleswarapu
Browse files

soc: qcom: fix to avoid invalid memory access



In error scenarios, tx_buf is accessed even after tx_buf
memory is freed up. This change is to avoid access to freed
up memory.

Change-Id: I93a2c5875474094da1de07ddaaad8a709193632f
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
Signed-off-by: default avatarNagaradhesh Yeleswarapu <nagaradh@qti.qualcomm.com>
parent eb3aad80
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -623,6 +623,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);
@@ -637,6 +638,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);
		/*
@@ -645,7 +647,6 @@ static void wdsp_glink_tx_buf_work(struct work_struct *work)
		 */
		kfree(tx_buf);
	}
	mutex_unlock(&tx_buf->ch->mutex);
}

/*