Commit 3f89f834 authored by Roland Dreier's avatar Roland Dreier

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: default avatarRoland Dreier <rolandd@cisco.com>
parent e71ac603
...@@ -607,10 +607,10 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd, ...@@ -607,10 +607,10 @@ static void srp_unmap_data(struct scsi_cmnd *scmnd,
*/ */
if (likely(scmnd->use_sg)) { if (likely(scmnd->use_sg)) {
nents = scmnd->use_sg; nents = scmnd->use_sg;
scat = (struct scatterlist *) scmnd->request_buffer; scat = scmnd->request_buffer;
} else { } else {
nents = 1; nents = 1;
scat = (struct scatterlist *) scmnd->request_buffer; scat = &req->fake_sg;
} }
dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents, dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment