From ca730e98e85febda62d3b5503500180fcb9a76ba Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Sat, 27 May 2017 08:35:56 +0000 Subject: 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@ --- sys/dev/pv/vioscsi.c | 16 +++++++++------- 1 file 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 -- cgit v1.2.3