summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBill Kuzeja <William.Kuzeja@stratus.com>2019-03-04 08:25:46 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-06 19:26:45 -0500
commitdb0f166e9a37215b15d5d732c98fa15219adccf0 (patch)
treee95bcbcb6ce35df0b8f61cbb6f62ea8f1f0de979 /drivers/scsi
parent31b6a05f86e690e1818116fd23c3be915cc9d9ed (diff)
scsi: qla2xxx: Fix panic in qla_dfs_tgt_counters_show
When trying to display tgt_counters in the debugfs, a panic can result. There is no null check for qpair after it is assigned in the for-loop. Unless vha->hw->queue_pair_map array is completely filled with entries, the system will panic dereferencing a null pointer. Signed-off-by: Bill Kuzeja <william.kuzeja@stratus.com> Acked-by: Himanshu Madhani <hmadhani@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_dfs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_dfs.c b/drivers/scsi/qla2xxx/qla_dfs.c
index ead17288e2a7..5819a45ac5ef 100644
--- a/drivers/scsi/qla2xxx/qla_dfs.c
+++ b/drivers/scsi/qla2xxx/qla_dfs.c
@@ -193,6 +193,8 @@ qla_dfs_tgt_counters_show(struct seq_file *s, void *unused)
193 193
194 for (i = 0; i < vha->hw->max_qpairs; i++) { 194 for (i = 0; i < vha->hw->max_qpairs; i++) {
195 qpair = vha->hw->queue_pair_map[i]; 195 qpair = vha->hw->queue_pair_map[i];
196 if (!qpair)
197 continue;
196 qla_core_sbt_cmd += qpair->tgt_counters.qla_core_sbt_cmd; 198 qla_core_sbt_cmd += qpair->tgt_counters.qla_core_sbt_cmd;
197 core_qla_que_buf += qpair->tgt_counters.core_qla_que_buf; 199 core_qla_que_buf += qpair->tgt_counters.core_qla_que_buf;
198 qla_core_ret_ctio += qpair->tgt_counters.qla_core_ret_ctio; 200 qla_core_ret_ctio += qpair->tgt_counters.qla_core_ret_ctio;