patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Robin Zhang <robinx.zhang@intel.com>
To: robinx.zhang@intel.com
Cc: stable@dpdk.org, Christopher Pau <christopher.pau@intel.com>
Subject: [dpdk-stable] [PATCH v5 11/17] net/i40e/base: fix potentially uninitialized variables
Date: Fri,  8 Oct 2021 11:55:30 +0000	[thread overview]
Message-ID: <20211008115536.61352-12-robinx.zhang@intel.com> (raw)
In-Reply-To: <20211008115536.61352-1-robinx.zhang@intel.com>

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>
---
 drivers/net/i40e/base/i40e_adminq.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c
index 38d3429e5b..27c82d9b44 100644
--- a/drivers/net/i40e/base/i40e_adminq.c
+++ b/drivers/net/i40e/base/i40e_adminq.c
@@ -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 */
-- 
2.25.1


  parent reply	other threads:[~2021-10-08 12:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211008115536.61352-1-robinx.zhang@intel.com>
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 05/17] net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters Robin Zhang
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 06/17] net/i40e/base: fix PF reset Robin Zhang
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 07/17] net/i40e/base: fix update link data for X722 Robin Zhang
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 08/17] net/i40e/base: fix AOC media type Robin Zhang
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 10/17] net/i40e/base: fix headers to match functions Robin Zhang
2021-10-08 11:55 ` Robin Zhang [this message]
2021-10-08 11:55 ` [dpdk-stable] [PATCH v5 12/17] net/i40e/base: fix checksum is used incorrectly Robin Zhang
     [not found] <20210618063851.3694702-1-robinx.zhang@intel.com>
     [not found] ` <20211009012648.64838-1-robinx.zhang@intel.com>
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 11/17] net/i40e/base: fix potentially uninitialized variables Robin Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008115536.61352-12-robinx.zhang@intel.com \
    --to=robinx.zhang@intel.com \
    --cc=christopher.pau@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).