diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-12-12 13:24:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-12-12 13:24:59 +0000 |
commit | 7b27b3b02a49449a871d30faf27c00ac203720cd (patch) | |
tree | 91d4b2f2a51f5285cc1b2dfa7fecdb50c41209a3 /sys | |
parent | 57d66c3026d59b18aa8e188824d3d2f0afaf2530 (diff) |
Add missing splbio() protection when sending commands to the vDisk server.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/dev/vdsk.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/sparc64/dev/vdsk.c b/sys/arch/sparc64/dev/vdsk.c index c8120ed7f7d..655c0e3571d 100644 --- a/sys/arch/sparc64/dev/vdsk.c +++ b/sys/arch/sparc64/dev/vdsk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vdsk.c,v 1.15 2009/12/09 22:39:52 kettenis Exp $ */ +/* $OpenBSD: vdsk.c,v 1.16 2009/12/12 13:24:58 kettenis Exp $ */ /* * Copyright (c) 2009 Mark Kettenis * @@ -975,9 +975,12 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) int desc, s; int timeout; + s = splbio(); if (sc->sc_vio_state != VIO_ESTABLISHED || - sc->sc_tx_cnt >= sc->sc_vd->vd_nentries) + sc->sc_tx_cnt >= sc->sc_vd->vd_nentries) { + splx(s); return (NO_CCB); + } desc = sc->sc_tx_prod; @@ -1033,10 +1036,11 @@ vdsk_scsi_cmd(struct scsi_xfer *xs) dm.start_idx = dm.end_idx = desc; vdsk_sendmsg(sc, &dm, sizeof(dm)); - if (!ISSET(xs->flags, SCSI_POLL)) + if (!ISSET(xs->flags, SCSI_POLL)) { + splx(s); return (SUCCESSFULLY_QUEUED); + } - s = splbio(); timeout = 1000; do { if (vdsk_rx_intr(sc) && |