aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla4xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla4xxx')
-rw-r--r--drivers/scsi/qla4xxx/ql4_isr.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_isr.c b/drivers/scsi/qla4xxx/ql4_isr.c
index 4a154beb0d39..0f029d0d7315 100644
--- a/drivers/scsi/qla4xxx/ql4_isr.c
+++ b/drivers/scsi/qla4xxx/ql4_isr.c
@@ -123,15 +123,14 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
123 break; 123 break;
124 124
125 /* Copy Sense Data into sense buffer. */ 125 /* Copy Sense Data into sense buffer. */
126 memset(cmd->sense_buffer, 0, sizeof(cmd->sense_buffer)); 126 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
127 127
128 sensebytecnt = le16_to_cpu(sts_entry->senseDataByteCnt); 128 sensebytecnt = le16_to_cpu(sts_entry->senseDataByteCnt);
129 if (sensebytecnt == 0) 129 if (sensebytecnt == 0)
130 break; 130 break;
131 131
132 memcpy(cmd->sense_buffer, sts_entry->senseData, 132 memcpy(cmd->sense_buffer, sts_entry->senseData,
133 min(sensebytecnt, 133 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
134 (uint16_t) sizeof(cmd->sense_buffer)));
135 134
136 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, " 135 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
137 "ASC/ASCQ = %02x/%02x\n", ha->host_no, 136 "ASC/ASCQ = %02x/%02x\n", ha->host_no,
@@ -208,8 +207,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
208 break; 207 break;
209 208
210 /* Copy Sense Data into sense buffer. */ 209 /* Copy Sense Data into sense buffer. */
211 memset(cmd->sense_buffer, 0, 210 memset(cmd->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
212 sizeof(cmd->sense_buffer));
213 211
214 sensebytecnt = 212 sensebytecnt =
215 le16_to_cpu(sts_entry->senseDataByteCnt); 213 le16_to_cpu(sts_entry->senseDataByteCnt);
@@ -217,8 +215,7 @@ static void qla4xxx_status_entry(struct scsi_qla_host *ha,
217 break; 215 break;
218 216
219 memcpy(cmd->sense_buffer, sts_entry->senseData, 217 memcpy(cmd->sense_buffer, sts_entry->senseData,
220 min(sensebytecnt, 218 min_t(uint16_t, sensebytecnt, SCSI_SENSE_BUFFERSIZE));
221 (uint16_t) sizeof(cmd->sense_buffer)));
222 219
223 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, " 220 DEBUG2(printk("scsi%ld:%d:%d:%d: %s: sense key = %x, "
224 "ASC/ASCQ = %02x/%02x\n", ha->host_no, 221 "ASC/ASCQ = %02x/%02x\n", ha->host_no,