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

Commit a1e1a009 authored by Vidyakumar Athota's avatar Vidyakumar Athota
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>
parent a1ccb4d4
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -604,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);
@@ -618,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);
		/*
@@ -626,7 +628,6 @@ static void wdsp_glink_tx_buf_work(struct work_struct *work)
		 */
		kfree(tx_buf);
	}
	mutex_unlock(&tx_buf->ch->mutex);
}

/*