diff options
author | Roland Dreier <rolandd@cisco.com> | 2006-03-29 12:36:45 -0500 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-03-29 12:36:45 -0500 |
commit | 3f89f834497c0f37f16a3b6c32b1d60782facbca (patch) | |
tree | 4a27d2b5ed847fd90678d3e7758fe08b493426e1 /drivers | |
parent | e71ac6032edf77a1e4a81f3e3b260807e94b37a5 (diff) |
IB/srp: Fix unmapping of fake scatterlist
The recently merged patch to create a fake scatterlist for non-SG SCSI
commands had a bug: the driver ended up doing dma_unmap_sg() on a
scatterlist scmnd->request_buffer rather than the fake scatter list it
created. Fix this so that the driver unmaps the same thing it maps.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 61924cc30e55..fd8a95a9c5d3 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -607,10 +607,10 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd, | |||
607 | */ | 607 | */ |
608 | if (likely(scmnd->use_sg)) { | 608 | if (likely(scmnd->use_sg)) { |
609 | nents = scmnd->use_sg; | 609 | nents = scmnd->use_sg; |
610 | scat = (struct scatterlist *) scmnd->request_buffer; | 610 | scat = scmnd->request_buffer; |
611 | } else { | 611 | } else { |
612 | nents = 1; | 612 | nents = 1; |
613 | scat = (struct scatterlist *) scmnd->request_buffer; | 613 | scat = &req->fake_sg; |
614 | } | 614 | } |
615 | 615 | ||
616 | dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents, | 616 | dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents, |