summaryrefslogtreecommitdiffstats
path: root/share/examples
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-03-25 18:18:26 +0000
committermjacob <mjacob@FreeBSD.org>2006-03-25 18:18:26 +0000
commit851b87ce3b8a9c281d79bfc15e6a6011bdaa6ee3 (patch)
tree7c1866f09e990e3577dd4d2e2f45bfac06465e41 /share/examples
parent1cfd88a69729e158fe5ff02e63458690749fc413 (diff)
downloadFreeBSD-src-851b87ce3b8a9c281d79bfc15e6a6011bdaa6ee3.zip
FreeBSD-src-851b87ce3b8a9c281d79bfc15e6a6011bdaa6ee3.tar.gz
Move the check for non-ATIO_CMD ahead of the cache chech so that
completion for unsupported commands doesn't abort. Reviewed by: nate MFC after: 2 weeks
Diffstat (limited to 'share/examples')
-rw-r--r--share/examples/scsi_target/scsi_cmds.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c
index 33d1cec..dd0b069 100644
--- a/share/examples/scsi_target/scsi_cmds.c
+++ b/share/examples/scsi_target/scsi_cmds.c
@@ -155,6 +155,16 @@ tcmd_handle(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, io_ops event)
}
last_cmd = h;
}
+
+ /* call completion and exit */
+ if (event != ATIO_WORK) {
+ if (last_cmd->done != NULL)
+ last_cmd->done(atio, ctio, event);
+ else
+ free_ccb((union ccb *)ctio);
+ return (1);
+ }
+
if (last_cmd->cmd == ILLEGAL_CDB) {
if (event != ATIO_WORK) {
warnx("no done func for %#x???", a_descr->cdb[0]);
@@ -167,15 +177,6 @@ tcmd_handle(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, io_ops event)
return (0);
}
- /* call completion and exit */
- if (event != ATIO_WORK) {
- if (last_cmd->done != NULL)
- last_cmd->done(atio, ctio, event);
- else
- free_ccb((union ccb *)ctio);
- return (1);
- }
-
istate = tcmd_get_istate(ctio->init_id);
if (istate == NULL) {
tcmd_illegal_req(atio, ctio);
OpenPOWER on IntegriCloud