summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2009-01-17 20:36:42 +0000
committerkettenis <kettenis@openbsd.org>2009-01-17 20:36:42 +0000
commit60e8abf15222e4a7179f91ba619be021f0cb3741 (patch)
tree4f75a536881983375c2e8ec9e0eed88a89e8b650 /sys
parentAdd support for DS1822 to owtemp(4). (diff)
downloadwireguard-openbsd-60e8abf15222e4a7179f91ba619be021f0cb3741.tar.xz
wireguard-openbsd-60e8abf15222e4a7179f91ba619be021f0cb3741.zip
Return NO_CCB if we run out of descriptors.
Suggested by krw@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/vdsk.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c
index 26af51b70df..3fbd6f8fc10 100644
--- a/sys/arch/sparc64/dev/vdsk.c
+++ b/sys/arch/sparc64/dev/vdsk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vdsk.c,v 1.6 2009/01/17 17:11:10 kettenis Exp $ */
+/* $OpenBSD: vdsk.c,v 1.7 2009/01/17 20:36:42 kettenis Exp $ */
/*
* Copyright (c) 2009 Mark Kettenis
*
@@ -922,7 +922,8 @@ vdsk_scsi_cmd(struct scsi_xfer *xs)
int desc, s;
int timeout;
- KASSERT(sc->sc_tx_cnt < sc->sc_vd->vd_nentries);
+ if (sc->sc_tx_cnt >= sc->sc_vd->vd_nentries)
+ return (NO_CCB);
desc = sc->sc_tx_prod;