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

Commit 628ff39c authored by Dilip Kota's avatar Dilip Kota
Browse files

slim-msm-ngd:Avoid using stale pipe handle



Make sure to use pipe handle from the TX
endpoint rather than using a stored handle.
The stored handle may become invalid if SSR
happens between storing of that handle
and locking the mutex.

Change-Id: I53e8f860c2d50061b6c4e6ce2f944c1e2ed8dff2
Signed-off-by: default avatarDilip Kota <dkota@codeaurora.org>
parent d3068532
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -711,7 +711,6 @@ static int ngd_bulk_wr(struct slim_controller *ctrl, u8 la, u8 mt, u8 mc,
	struct msm_slim_ctrl *dev = slim_get_ctrldata(ctrl);
	int i, ret;
	struct msm_slim_endp *endpoint = &dev->tx_msgq;
	struct sps_pipe *pipe = endpoint->sps;
	u32 *header;
	DECLARE_COMPLETION_ONSTACK(done);

@@ -808,8 +807,8 @@ static int ngd_bulk_wr(struct slim_controller *ctrl, u8 la, u8 mt, u8 mc,
		goto retpath;
	}

	ret = sps_transfer_one(pipe, dev->bulk.wr_dma, dev->bulk.size, NULL,
				SPS_IOVEC_FLAG_EOT);
	ret = sps_transfer_one(endpoint->sps, dev->bulk.wr_dma, dev->bulk.size,
						NULL, SPS_IOVEC_FLAG_EOT);
	if (ret) {
		SLIM_WARN(dev, "sps transfer one returned error:%d", ret);
		goto retpath;