summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2017-03-19 16:37:20 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2017-03-19 16:37:20 +0000
commit3385571095c5c37f1604015146daa5ad90762f00 (patch)
tree02f91ef7e01589b0f7b3f3363565cd1450212eb2 /sys/dev/pv
parent80216302e87e56af0cda380e22f2cefedb271397 (diff)
Fixup starting block number calculation for bounced transfers
From Nathanael Rensen, thanks!
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/xbf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pv/xbf.c b/sys/dev/pv/xbf.c
index cd15d64923b..d5c44770acb 100644
--- a/sys/dev/pv/xbf.c
+++ b/sys/dev/pv/xbf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xbf.c,v 1.27 2017/03/19 16:26:28 mikeb Exp $ */
+/* $OpenBSD: xbf.c,v 1.28 2017/03/19 16:37:19 mikeb Exp $ */
/*
* Copyright (c) 2016 Mike Belopuhov
@@ -534,13 +534,13 @@ xbf_bounce_xs(struct scsi_xfer *xs, int desc)
sc->sc_dev.dv_xname, xs->datalen, size, map->dm_nsegs);
if (ISSET(xs->flags, SCSI_DATA_OUT))
- memcpy((caddr_t)dma->dma_vaddr, xs->data, xs->datalen);
+ memcpy(dma->dma_vaddr, xs->data, xs->datalen);
for (i = 0; i < map->dm_nsegs; i++) {
sge = &xrd->xrd_req.req_sgl[i];
sge->sge_ref = map->dm_segs[i].ds_addr;
sge->sge_first = i > 0 ? 0 :
- ((vaddr_t)xs->data & PAGE_MASK) >> XBF_SEC_SHIFT;
+ ((vaddr_t)dma->dma_vaddr & PAGE_MASK) >> XBF_SEC_SHIFT;
sge->sge_last = sge->sge_first +
(map->dm_segs[i].ds_len >> XBF_SEC_SHIFT) - 1;