> +static sense_reason_t iblock_execute_pr_in(struct se_cmd *cmd, u8 sa, > + unsigned char *param_data) > +{ > + sense_reason_t ret; > + > + switch (sa) { > + case PRI_REPORT_CAPABILITIES: > + iblock_pr_report_caps(param_data); > + break; > + case PRI_READ_KEYS: > + ret = iblock_pr_read_keys(cmd, param_data); > + break; > + case PRI_READ_RESERVATION: > + ret = iblock_pr_read_reservation(cmd, param_data); > + break; > + case PRI_READ_FULL_STATUS: > + default: > + pr_err("Unknown PERSISTENT_RESERVE_IN SA: 0x%02x\n", sa); > + return TCM_UNSUPPORTED_SCSI_OPCODE; > + } > + > + return ret; ret is uninitialize in the iblock_pr_report_caps case. > + switch (cdb[0]) { > + case RESERVE: > + case RESERVE_10: > + case RELEASE: > + case RELEASE_10: > + /* > + * The block layer pr_ops don't support the old RESERVE/RELEASE > + * commands. > + */ > + if (dev->dev_attrib.emulate_pr && > + (dev->transport_flags & TRANSPORT_FLAG_PASSTHROUGH_PGR)) > + return TCM_UNSUPPORTED_SCSI_OPCODE; > + } Can't this check go straight int sbc_parse_cdb?