From 441201ce65bf4becf093801b23ab4a4604ee43d8 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Sat, 25 Mar 2006 18:18:26 +0000 Subject: [PATCH] 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 --- share/examples/scsi_target/scsi_cmds.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c index 33d1ceca6a21..dd0b0694f1ad 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);