summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBill Kuzeja <William.Kuzeja@stratus.com>2019-03-04 14:25:46 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2019-03-07 01:26:45 +0100
commitdb0f166e9a37215b15d5d732c98fa15219adccf0 (patch)
treee95bcbcb6ce35df0b8f61cbb6f62ea8f1f0de979 /drivers
parentscsi: megaraid_sas: reduce module load time (diff)
downloadlinux-db0f166e9a37215b15d5d732c98fa15219adccf0.tar.xz
linux-db0f166e9a37215b15d5d732c98fa15219adccf0.zip
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')
-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)
for (i = 0; i < vha->hw->max_qpairs; i++) {
qpair = vha->hw->queue_pair_map[i];
+ if (!qpair)
+ continue;
qla_core_sbt_cmd += qpair->tgt_counters.qla_core_sbt_cmd;
core_qla_que_buf += qpair->tgt_counters.core_qla_que_buf;
qla_core_ret_ctio += qpair->tgt_counters.qla_core_ret_ctio;