Skip to content

Commit

Permalink
net/i40e/base: fix potentially uninitialized variables
Browse files Browse the repository at this point in the history
[ upstream commit bc99971 ]

The status of i40e_read_nvm_word is not checked, so variables set
from this function could be used uninitialized. In this case, preserve
the existing flow that does not block initialization by initializing
these values from the start.

Fixes: 8d6c51f ("i40e/base: get OEM version")
Fixes: 2db7057 ("net/i40e/base: limit PF/VF specific code to that driver only")

Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
  • Loading branch information
RobinXZhang authored and cpaelzer committed Nov 30, 2021
1 parent b483ed5 commit 8406d53
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/net/i40e/base/i40e_adminq.c
Expand Up @@ -587,8 +587,10 @@ STATIC void i40e_resume_aq(struct i40e_hw *hw)
enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
{
#ifdef PF_DRIVER
u16 cfg_ptr, oem_hi, oem_lo;
u16 eetrack_lo, eetrack_hi;
u16 oem_hi = 0, oem_lo = 0;
u16 eetrack_hi = 0;
u16 eetrack_lo = 0;
u16 cfg_ptr = 0;
#endif
enum i40e_status_code ret_code;
#ifdef PF_DRIVER
Expand Down

0 comments on commit 8406d53

Please sign in to comment.