net/qede: initialize ptt to prevent derefence
PATCH 1/1 net/qede: initialize ptt to prevent derefence
From: Mark Bulatov <[email protected]>
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")
Signed-off-by Alexey Simakov <[email protected]>
Signed-off-by Mark Bulatov <[email protected]>
--- drivers/net/qede/qede_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/qede/qede_main.c +4 -2
@@ -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 ;
Signature · 1 line
2.39.5