Skip to content

Commit 3f89f83

Browse files
author
Roland Dreier
committed
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>
1 parent e71ac60 commit 3f89f83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/infiniband/ulp/srp/ib_srp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,10 +607,10 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
607607
*/
608608
if (likely(scmnd->use_sg)) {
609609
nents = scmnd->use_sg;
610-
scat = (struct scatterlist *) scmnd->request_buffer;
610+
scat = scmnd->request_buffer;
611611
} else {
612612
nents = 1;
613-
scat = (struct scatterlist *) scmnd->request_buffer;
613+
scat = &req->fake_sg;
614614
}
615615

616616
dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents,

0 commit comments

Comments
 (0)