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: Dilip Kota <dkota@codeaurora.org>
This commit is contained in:
Dilip Kota 2016-03-30 13:22:20 +05:30 committed by Gerrit - the friendly Code Review server
parent c69a4a60de
commit 9a5cd01d7b
1 changed files with 2 additions and 3 deletions

View File

@ -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;