From: Joe Carnuccio <joe.carnuc...@cavium.com>

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.carnuc...@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madh...@cavium.com>
---
 drivers/scsi/qla2xxx/qla_tmpl.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index b18646d6057f..733e8dcccf5c 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -443,8 +443,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;
 }
@@ -692,11 +696,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;
 }
-- 
2.12.0

Reply via email to