diff options
author | Robert Elliott <elliott@hp.com> | 2014-07-03 10:18:19 -0500 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:17:00 -0400 |
commit | 6aa4c361bf8b1f08b34fb6c581db352d7f7cff46 (patch) | |
tree | c1bd30c4f19f0d75eec26b34bec286b3781a53f5 /drivers/scsi/hpsa.c | |
parent | 3fa89a04e064e586df4ed3208a8e62012a65b17f (diff) | |
download | linux-6aa4c361bf8b1f08b34fb6c581db352d7f7cff46.tar.bz2 |
hpsa: do not unconditionally copy sense data
Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Reviewed-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/hpsa.c')
-rw-r--r-- | drivers/scsi/hpsa.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 6edd2aaacbab..10aed7dae609 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -1708,7 +1708,14 @@ static void complete_scsi_command(struct CommandList *cp) cmd->result |= ei->ScsiStatus; - /* copy the sense data whether we need to or not. */ + scsi_set_resid(cmd, ei->ResidualCnt); + if (ei->CommandStatus == 0) { + cmd_free(h, cp); + cmd->scsi_done(cmd); + return; + } + + /* copy the sense data */ if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo)) sense_data_size = SCSI_SENSE_BUFFERSIZE; else @@ -1717,13 +1724,6 @@ static void complete_scsi_command(struct CommandList *cp) sense_data_size = ei->SenseLen; memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size); - scsi_set_resid(cmd, ei->ResidualCnt); - - if (ei->CommandStatus == 0) { - cmd_free(h, cp); - cmd->scsi_done(cmd); - return; - } /* For I/O accelerator commands, copy over some fields to the normal * CISS header used below for error handling. |