OSDN Git Service

scsi: qla2xxx: Fix panic in qla_dfs_tgt_counters_show
authorBill Kuzeja <William.Kuzeja@stratus.com>
Mon, 4 Mar 2019 13:25:46 +0000 (08:25 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 7 Mar 2019 00:26:45 +0000 (19:26 -0500)
commitdb0f166e9a37215b15d5d732c98fa15219adccf0
treee95bcbcb6ce35df0b8f61cbb6f62ea8f1f0de979
parent31b6a05f86e690e1818116fd23c3be915cc9d9ed
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>
drivers/scsi/qla2xxx/qla_dfs.c