Commit 4812d070 authored by Santosh Vernekar's avatar Santosh Vernekar Committed by James Bottomley

[SCSI] qla4xxx: Fix the minidump data collection check in for loop

Signed-off-by: default avatarSantosh Vernekar <santosh.vernekar@qlogic.com>
Signed-off-by: default avatarVikas Chaudhary <vikas.chaudhary@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 41f79bde
...@@ -2628,7 +2628,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha) ...@@ -2628,7 +2628,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha)
/* Walk through the entry headers - validate/perform required action */ /* Walk through the entry headers - validate/perform required action */
for (i = 0; i < num_entry_hdr; i++) { for (i = 0; i < num_entry_hdr; i++) {
if (data_collected >= ha->fw_dump_size) { if (data_collected > ha->fw_dump_size) {
ql4_printk(KERN_INFO, ha, ql4_printk(KERN_INFO, ha,
"Data collected: [0x%x], Total Dump size: [0x%x]\n", "Data collected: [0x%x], Total Dump size: [0x%x]\n",
data_collected, ha->fw_dump_size); data_collected, ha->fw_dump_size);
...@@ -2753,9 +2753,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha) ...@@ -2753,9 +2753,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha)
break; break;
} }
data_collected = (uint8_t *)data_ptr - data_collected = (uint8_t *)data_ptr - (uint8_t *)ha->fw_dump;
((uint8_t *)((uint8_t *)ha->fw_dump +
ha->fw_dump_tmplt_size));
skip_nxt_entry: skip_nxt_entry:
/* next entry in the template */ /* next entry in the template */
entry_hdr = (struct qla8xxx_minidump_entry_hdr *) entry_hdr = (struct qla8xxx_minidump_entry_hdr *)
...@@ -2763,7 +2761,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha) ...@@ -2763,7 +2761,7 @@ static int qla4_8xxx_collect_md_data(struct scsi_qla_host *ha)
entry_hdr->entry_size); entry_hdr->entry_size);
} }
if ((data_collected + ha->fw_dump_tmplt_size) != ha->fw_dump_size) { if (data_collected != ha->fw_dump_size) {
ql4_printk(KERN_INFO, ha, ql4_printk(KERN_INFO, ha,
"Dump data mismatch: Data collected: [0x%x], total_data_size:[0x%x]\n", "Dump data mismatch: Data collected: [0x%x], total_data_size:[0x%x]\n",
data_collected, ha->fw_dump_size); data_collected, ha->fw_dump_size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment