Skip to content

Commit

Permalink
IB/srp: Fix unmapping of fake scatterlist
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Roland Dreier committed Mar 29, 2006
1 parent e71ac60 commit 3f89f83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,10 +607,10 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
*/
if (likely(scmnd->use_sg)) {
nents = scmnd->use_sg;
scat = (struct scatterlist *) scmnd->request_buffer;
scat = scmnd->request_buffer;
} else {
nents = 1;
scat = (struct scatterlist *) scmnd->request_buffer;
scat = &req->fake_sg;
}

dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents,
Expand Down

0 comments on commit 3f89f83

Please sign in to comment.