From eb48191dd5cb2be0e1d83999b85863da65a87c02 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 21 Mar 2011 18:51:33 +0000 Subject: [PATCH] Fix for incorrectly handled SERVICE_ACTION_IN opcodes other than SAI_READ_CAPACITY_16. Reported by Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3295 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_vdisk.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index a368f56b8..8d397549c 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1200,15 +1200,13 @@ static int vdisk_do_job(struct scst_cmd *cmd) vdisk_exec_read_capacity16(cmd); break; } + goto out_invalid_opcode; case UNMAP: vdisk_exec_unmap(cmd, thr); break; - /* else go through */ case REPORT_LUNS: default: - TRACE_DBG("Invalid opcode %d", opcode); - scst_set_cmd_error(cmd, - SCST_LOAD_SENSE(scst_sense_invalid_opcode)); + goto out_invalid_opcode; } out_compl: @@ -1225,6 +1223,12 @@ out_thr: TRACE_EXIT_RES(res); return res; + +out_invalid_opcode: + TRACE_DBG("Invalid opcode %d", opcode); + scst_set_cmd_error(cmd, + SCST_LOAD_SENSE(scst_sense_invalid_opcode)); + goto out_compl; } static int vdisk_get_block_shift(struct scst_cmd *cmd)