summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-08-04 21:26:35 +0000
committermillert <millert@openbsd.org>1998-08-04 21:26:35 +0000
commit7ff67ff677dce1e336feaa9a1f3be7388aab5811 (patch)
treed16b1b039e2c7793e906a4873fa9fb99fbe0df49
parentAdd hack to SIOCGIFCONF where if ifc_len is 0, fill it in with the size needed and return; Linux does this too. Suggested by cmetz@inner.net (diff)
downloadwireguard-openbsd-7ff67ff677dce1e336feaa9a1f3be7388aab5811.tar.xz
wireguard-openbsd-7ff67ff677dce1e336feaa9a1f3be7388aab5811.zip
don't rely on b_resid being signed
-rw-r--r--sys/dev/ccd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 0b7987afe33..575b5693981 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.35 1998/03/10 20:43:17 millert Exp $ */
+/* $OpenBSD: ccd.c,v 1.36 1998/08/04 21:26:35 millert Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -1098,9 +1098,9 @@ ccdiodone(vbp)
* Note that mirror component buffers aren't counted against
* the original I/O buffer.
*/
- bp->b_resid -= count;
- if (bp->b_resid < 0)
+ if (count > bp->b_resid)
panic("ccdiodone: count");
+ bp->b_resid -= count;
if (bp->b_resid == 0)
ccdintr(&ccd_softc[unit], bp);
}