mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
Should have been included in the previous commit (r1371).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1372 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2311,11 +2311,6 @@ static void srpt_unmap_sg_to_ib_sge(struct srpt_rdma_ch *ch,
|
||||
struct scatterlist *scat;
|
||||
scst_data_direction dir;
|
||||
|
||||
scmnd = ioctx->scmnd;
|
||||
BUG_ON(!scmnd);
|
||||
BUG_ON(ioctx != scst_cmd_get_tgt_priv(scmnd));
|
||||
scat = scst_cmd_get_sg(scmnd);
|
||||
|
||||
BUG_ON(ioctx->n_rdma && !ioctx->rdma_ius);
|
||||
|
||||
while (ioctx->n_rdma)
|
||||
@@ -2324,11 +2319,16 @@ static void srpt_unmap_sg_to_ib_sge(struct srpt_rdma_ch *ch,
|
||||
kfree(ioctx->rdma_ius);
|
||||
ioctx->rdma_ius = NULL;
|
||||
|
||||
if (scat) {
|
||||
dir = scst_cmd_get_data_direction(scmnd);
|
||||
ib_dma_unmap_sg(ch->sport->sdev->device,
|
||||
scat, scst_cmd_get_sg_cnt(scmnd),
|
||||
scst_to_tgt_dma_dir(dir));
|
||||
scmnd = ioctx->scmnd;
|
||||
if (scmnd) {
|
||||
BUG_ON(ioctx != scst_cmd_get_tgt_priv(scmnd));
|
||||
scat = scst_cmd_get_sg(scmnd);
|
||||
if (scat) {
|
||||
dir = scst_cmd_get_data_direction(scmnd);
|
||||
ib_dma_unmap_sg(ch->sport->sdev->device,
|
||||
scat, scst_cmd_get_sg_cnt(scmnd),
|
||||
scst_to_tgt_dma_dir(dir));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user