mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 11:41:26 +00:00
qla2x00t: Avoid that an SRR for a command without data triggers a kernel oops (merge r4747 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4752 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4307,7 +4307,8 @@ static void q24_handle_srr(scsi_qla_host_t *ha, struct srr_ctio *sctio,
|
||||
break;
|
||||
case SRR_IU_DATA_IN:
|
||||
cmd->bufflen = scst_cmd_get_adjusted_resp_data_len(cmd->scst_cmd);
|
||||
if (q2t_has_data(cmd)) {
|
||||
if (q2t_has_data(cmd) &&
|
||||
(scst_cmd_get_data_direction(cmd->scst_cmd) & SCST_DATA_READ)) {
|
||||
uint32_t offset;
|
||||
int xmit_type;
|
||||
offset = le32_to_cpu(imm->imm.notify_entry24.srr_rel_offs);
|
||||
@@ -4320,16 +4321,18 @@ static void q24_handle_srr(scsi_qla_host_t *ha, struct srr_ctio *sctio,
|
||||
__q24_xmit_response(cmd, xmit_type);
|
||||
} else {
|
||||
PRINT_ERROR("qla2x00t(%ld): SRR for in data for cmd "
|
||||
"without them (tag %d, SCSI status %d), "
|
||||
"reject", ha->instance, cmd->tag,
|
||||
scst_cmd_get_status(cmd->scst_cmd));
|
||||
"without them (tag %d, SCSI status %d, dir %d),"
|
||||
" reject", ha->instance, cmd->tag,
|
||||
scst_cmd_get_status(cmd->scst_cmd),
|
||||
scst_cmd_get_data_direction(cmd->scst_cmd));
|
||||
goto out_reject;
|
||||
}
|
||||
break;
|
||||
case SRR_IU_DATA_OUT:
|
||||
cmd->bufflen = scst_cmd_get_write_fields(cmd->scst_cmd,
|
||||
&cmd->sg, &cmd->sg_cnt);
|
||||
if (q2t_has_data(cmd)) {
|
||||
if (q2t_has_data(cmd) &&
|
||||
(scst_cmd_get_data_direction(cmd->scst_cmd) & SCST_DATA_WRITE)) {
|
||||
uint32_t offset;
|
||||
int xmit_type;
|
||||
offset = le32_to_cpu(imm->imm.notify_entry24.srr_rel_offs);
|
||||
@@ -4343,9 +4346,10 @@ static void q24_handle_srr(scsi_qla_host_t *ha, struct srr_ctio *sctio,
|
||||
__q2t_rdy_to_xfer(cmd);
|
||||
} else {
|
||||
PRINT_ERROR("qla2x00t(%ld): SRR for out data for cmd "
|
||||
"without them (tag %d, SCSI status %d), "
|
||||
"reject", ha->instance, cmd->tag,
|
||||
scst_cmd_get_status(cmd->scst_cmd));
|
||||
"without them (tag %d, SCSI status %d, dir %d),"
|
||||
" reject", ha->instance, cmd->tag,
|
||||
scst_cmd_get_status(cmd->scst_cmd),
|
||||
scst_cmd_get_data_direction(cmd->scst_cmd));
|
||||
goto out_reject;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user