summaryrefslogtreecommitdiff
path: root/sys/dev/pv
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2017-05-27 08:35:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2017-05-27 08:35:56 +0000
commitca730e98e85febda62d3b5503500180fcb9a76ba (patch)
tree12294d80370baa35f8c1fbd6bdbc60db9698f8e2 /sys/dev/pv
parent460b984bd245edf6c33f3e2a4f4c1f75cde903d3 (diff)
Move error path to end of function where god intended it
to be. goto'ing upwards into an 'if' statement block is weird. ok sf@
Diffstat (limited to 'sys/dev/pv')
-rw-r--r--sys/dev/pv/vioscsi.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/pv/vioscsi.c b/sys/dev/pv/vioscsi.c
index 8add3ed2b95..6c049caafdb 100644
--- a/sys/dev/pv/vioscsi.c
+++ b/sys/dev/pv/vioscsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vioscsi.c,v 1.8 2017/05/26 10:59:55 krw Exp $ */
+/* $OpenBSD: vioscsi.c,v 1.9 2017/05/27 08:35:55 krw Exp $ */
/*
* Copyright (c) 2013 Google Inc.
*
@@ -197,12 +197,7 @@ vioscsi_scsi_cmd(struct scsi_xfer *xs)
// TODO(matthew): Support bidirectional SCSI commands?
if ((xs->flags & (SCSI_DATA_IN | SCSI_DATA_OUT))
== (SCSI_DATA_IN | SCSI_DATA_OUT)) {
- stuffup:
- xs->error = XS_DRIVER_STUFFUP;
- xs->resid = xs->datalen;
- DPRINTF("vioscsi_scsi_cmd: stuffup\n");
- scsi_done(xs);
- return;
+ goto stuffup;
}
vr->vr_xs = xs;
@@ -294,6 +289,13 @@ vioscsi_scsi_cmd(struct scsi_xfer *xs)
DPRINTF("vioscsi_scsi_cmd: done (timeout=%d)\n", timeout);
}
splx(s);
+ return;
+
+stuffup:
+ xs->error = XS_DRIVER_STUFFUP;
+ xs->resid = xs->datalen;
+ DPRINTF("vioscsi_scsi_cmd: stuffup\n");
+ scsi_done(xs);
}
void