scsi: qla2xxx: Skip zero queue count entry during FW dump capture
authorJoe Carnuccio <joe.carnuccio@cavium.com>
Wed, 23 Aug 2017 22:05:22 +0000 (15:05 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 25 Aug 2017 02:29:32 +0000 (22:29 -0400)
If queue count is zero while reading FW dump template, for entry
T263/T274, skip capturing those entries during FW dump capture.

Signed-off-by: Joe Carnuccio <joe.carnuccio@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qla2xxx/qla_tmpl.c

index 33142610882f4d9bedce93076160180513ca5f82..98ced01169691512664c0ffba793387b985999ee 100644 (file)
@@ -449,8 +449,12 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
                qla27xx_skip_entry(ent, buf);
        }
 
-       if (buf)
-               ent->t263.num_queues = count;
+       if (buf) {
+               if (count)
+                       ent->t263.num_queues = count;
+               else
+                       qla27xx_skip_entry(ent, buf);
+       }
 
        return false;
 }
@@ -704,11 +708,12 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
                qla27xx_skip_entry(ent, buf);
        }
 
-       if (buf)
-               ent->t274.num_queues = count;
-
-       if (!count)
-               qla27xx_skip_entry(ent, buf);
+       if (buf) {
+               if (count)
+                       ent->t274.num_queues = count;
+               else
+                       qla27xx_skip_entry(ent, buf);
+       }
 
        return false;
 }