summaryrefslogtreecommitdiff
path: root/drivers/scsi/qedf/qedf.h
diff options
context:
space:
mode:
authorChad Dupuis <cdupuis@marvell.com>2020-04-16 11:43:13 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2020-04-18 00:55:29 +0300
commitad40f5256095c68dc17c991eb976261d5ea2daaa (patch)
treebab4d6390ed0992f61d5e749eccdb31a47620c6d /drivers/scsi/qedf/qedf.h
parentf6b172f21999cf5a18a49d6c028ba46b1c9ce02f (diff)
downloadlinux-ad40f5256095c68dc17c991eb976261d5ea2daaa.tar.xz
scsi: qedf: Fix crash when MFW calls for protocol stats while function is still probing
The MFW may make a call to qed and then to qedf for protocol statistics while the function is still probing. If this happens it's possible that some members of the struct qedf_ctx may not be fully initialized which can result in a NULL pointer dereference or general protection fault. To prevent this, add a new flag call QEDF_PROBING and set it when the __qedf_probe() function is active. Then in the qedf_get_protocol_tlv_data() function we can check if the function is still probing and return immediantely before any uninitialized structures can be touched. Link: https://lore.kernel.org/r/20200416084314.18851-9-skashyap@marvell.com Signed-off-by: Chad Dupuis <cdupuis@marvell.com> Signed-off-by: Saurav Kashyap <skashyap@marvell.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf/qedf.h')
-rw-r--r--drivers/scsi/qedf/qedf.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h
index f8a98e5e3cb5..e163be8af965 100644
--- a/drivers/scsi/qedf/qedf.h
+++ b/drivers/scsi/qedf/qedf.h
@@ -355,6 +355,7 @@ struct qedf_ctx {
#define QEDF_GRCDUMP_CAPTURE 4
#define QEDF_IN_RECOVERY 5
#define QEDF_DBG_STOP_IO 6
+#define QEDF_PROBING 8
unsigned long flags; /* Miscellaneous state flags */
int fipvlan_retries;
u8 num_queues;