summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/sili.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/ic/sili.c b/sys/dev/ic/sili.c
index 6179bfb249f..1fcd3d33151 100644
--- a/sys/dev/ic/sili.c
+++ b/sys/dev/ic/sili.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sili.c,v 1.25 2007/04/07 15:44:22 pascoe Exp $ */
+/* $OpenBSD: sili.c,v 1.26 2007/04/07 15:58:26 pascoe Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -878,7 +878,11 @@ sili_unload(struct sili_ccb *ccb)
BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(sc->sc_dmat, dmap);
- xa->resid = xa->datalen - sili_pread(sp, SILI_PREG_RX_COUNT(xa->tag));
+ if (xa->flags & ATA_F_READ)
+ xa->resid = xa->datalen - sili_pread(sp,
+ SILI_PREG_RX_COUNT(xa->tag));
+ else
+ xa->resid = 0;
}
int