net/i40e/base: fix potentially uninitialized variables
authorRobin Zhang <robinx.zhang@intel.com>
Sat, 9 Oct 2021 01:39:50 +0000 (01:39 +0000)
committerQi Zhang <qi.z.zhang@intel.com>
Sat, 9 Oct 2021 05:37:05 +0000 (07:37 +0200)
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: 8d6c51fcd24b ("i40e/base: get OEM version")
Fixes: 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver only")
Cc: stable@dpdk.org
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>
drivers/net/i40e/base/i40e_adminq.c

index 38d3429..27c82d9 100644 (file)
@@ -652,8 +652,10 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
 {
        struct i40e_adminq_info *aq = &hw->aq;
        enum i40e_status_code ret_code;
-       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;
        int retry = 0;
 
        /* verify input for valid configuration */