[PATCH] net/qede: initialize ptt to prevent derefence

Bulatov Mark ms.bulatov7 at gmail.com
Fri Nov 13 15:00:51 CET 2026


From: Mark Bulatov <ms.bulatov7 at gmail.com>

In the qed_fill_dev_info() function, ptt is passed as NULL into the else
block, which will lead to a null pointer dereference in
ecore_ptt_get_hw_addr().

Fix this by adding ptt initialization.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 86a2265e59 ("qede: add SRIOV support")
Cc: stable at dpdk.org

Signed-off-by: Alexey Simakov <bigalex934 at gmail.com>
Signed-off-by: Mark Bulatov <ms.bulatov7 at gmail.com>
---
 drivers/net/qede/qede_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index fd63262f3a..1aa30a0462 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -415,8 +415,10 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
 			ecore_ptt_release(ECORE_LEADING_HWFN(edev), ptt);
 		}
 	} else {
-		ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
-				      &dev_info->mfw_rev, NULL);
+		ptt = ecore_ptt_acquire(ECORE_LEADING_HWFN(edev));
+		if (ptt)
+			ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
+					      &dev_info->mfw_rev, NULL);
 	}
 
 	return 0;
-- 
2.39.5



More information about the dev mailing list