mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
isert: Make sure we don't call dma_unmap on memory we already unmapped
Signed-off-by: Yan Burman <yanb@mellanox.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5897 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -294,9 +294,11 @@ void isert_wr_release(struct isert_wr *wr)
|
||||
struct isert_device *isert_dev = wr->isert_dev;
|
||||
struct ib_device *ib_dev;
|
||||
|
||||
ib_dev = isert_dev->ib_dev;
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
if (isert_buf->sg_cnt) {
|
||||
ib_dev = isert_dev->ib_dev;
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
}
|
||||
isert_buf_release(isert_buf);
|
||||
}
|
||||
memset(wr, 0, sizeof(*wr));
|
||||
|
||||
@@ -359,6 +359,7 @@ static void isert_rdma_rd_completion_handler(struct isert_wr *wr)
|
||||
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
|
||||
isert_data_out_ready(&wr->pdu->iscsi);
|
||||
}
|
||||
@@ -371,6 +372,7 @@ static void isert_rdma_wr_completion_handler(struct isert_wr *wr)
|
||||
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
|
||||
isert_data_in_sent(&wr->pdu->iscsi);
|
||||
}
|
||||
@@ -543,9 +545,9 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
break;
|
||||
case ISER_WR_RDMA_READ:
|
||||
if (isert_buf->sg_cnt != 0) {
|
||||
isert_buf->sg_cnt = 0;
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
}
|
||||
isert_pdu_err(&isert_pdu->iscsi);
|
||||
break;
|
||||
@@ -554,9 +556,9 @@ static void isert_handle_wc_error(struct ib_wc *wc)
|
||||
break;
|
||||
case ISER_WR_RDMA_WRITE:
|
||||
if (isert_buf->sg_cnt != 0) {
|
||||
isert_buf->sg_cnt = 0;
|
||||
ib_dma_unmap_sg(ib_dev, isert_buf->sg, isert_buf->sg_cnt,
|
||||
isert_buf->dma_dir);
|
||||
isert_buf->sg_cnt = 0;
|
||||
}
|
||||
/* RDMA-WR and SEND response of a READ task
|
||||
are sent together, so when receiving RDMA-WR error,
|
||||
|
||||
Reference in New Issue
Block a user