summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2009-01-17 20:36:43 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2009-01-17 20:36:43 +0000
commite53a83f95418337d04f6cc3057f52e2053e34bab (patch)
tree17831242c572722bd314c7a341aed4122582df8c
parentd185b1a4f081405ed3f21065bbdaf7b3f355362c (diff)
Return NO_CCB if we run out of descriptors.
Suggested by krw@
-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;