Skip to content

Commit

Permalink
ctl_report_supported_opcodes: Rename invalid label to invalid_options
Browse files Browse the repository at this point in the history
This error handling is specific to an invalid value in the REPORTING
OPTIONS field of a REPORT SUPPORTED OPERATION CODES command.

While here, reuse the label for another case.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D46775
  • Loading branch information
bsdjhb committed Sep 25, 2024
1 parent c7a33fe commit 0063ef7
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions sys/cam/ctl/ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -7456,33 +7456,26 @@ ctl_report_supported_opcodes(struct ctl_scsiio *ctsio)
break;
case RSO_OPTIONS_OC:
if (ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) {
ctl_set_invalid_field(/*ctsio*/ ctsio,
/*sks_valid*/ 1,
/*command*/ 1,
/*field*/ 2,
/*bit_valid*/ 1,
/*bit*/ 2);
ctl_done((union ctl_io *)ctsio);
return (CTL_RETVAL_COMPLETE);
goto invalid_options;
}
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
case RSO_OPTIONS_OC_SA:
if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) == 0 ||
service_action >= 32) {
goto invalid;
goto invalid_options;
}
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
case RSO_OPTIONS_OC_ASA:
if ((ctl_cmd_table[opcode].flags & CTL_CMD_FLAG_SA5) != 0 &&
service_action >= 32) {
goto invalid;
goto invalid_options;
}
total_len = sizeof(struct scsi_report_supported_opcodes_one) + 32;
break;
default:
invalid:
invalid_options:
ctl_set_invalid_field(/*ctsio*/ ctsio,
/*sks_valid*/ 1,
/*command*/ 1,
Expand Down

0 comments on commit 0063ef7

Please sign in to comment.