patches for DPDK stable branches
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Zhang, RobinX" <robinx.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Guo, Junfeng" <junfeng.guo@intel.com>,
	"Yang, SteveX" <stevex.yang@intel.com>,
	"stable@dpdk.org" <stable@dpdk.org>,
	"Pau, Christopher" <christopher.pau@intel.com>
Subject: Re: [dpdk-stable] [PATCH 13/14] net/i40e/base: fix potentially uninitialized variables in NVM code
Date: Mon, 21 Jun 2021 06:52:48 +0000	[thread overview]
Message-ID: <MN2PR11MB3807A93B5358AE3F31E534B9F70A9@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210618063851.3694702-14-robinx.zhang@intel.com>



> -----Original Message-----
> From: Zhang, RobinX <robinx.zhang@intel.com>
> Sent: Friday, June 18, 2021 2:39 PM
> To: dev@dpdk.org
> Cc: Xing, Beilei <beilei.xing@intel.com>; Guo, Junfeng
> <junfeng.guo@intel.com>; Yang, SteveX <stevex.yang@intel.com>; Zhang,
> RobinX <robinx.zhang@intel.com>; stable@dpdk.org; Pau, Christopher
> <christopher.pau@intel.com>
> Subject: [PATCH 13/14] net/i40e/base: fix potentially uninitialized variables in
> NVM code

Seems there're 2 fixes in the patch, please split them.

> 
> 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.
> 
> The variable checksum from i40e_calc_nvm_checksum is used before return
> value is checked. Fix this logic.
> 
> Fixes: 8d6c51fcd24b ("i40e/base: get OEM version")
> Fixes: 2db70574247b ("net/i40e/base: limit PF/VF specific code to that driver
> only")
> Fixes: 8db9e2a1b232 ("i40e: base driver")
> Fixes: 3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
> 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 ++++--
>  drivers/net/i40e/base/i40e_nvm.c    | 5 +++--
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/i40e/base/i40e_adminq.c
> b/drivers/net/i40e/base/i40e_adminq.c
> index eafacbdbec..d27ccde29a 100644
> --- a/drivers/net/i40e/base/i40e_adminq.c
> +++ b/drivers/net/i40e/base/i40e_adminq.c
> @@ -648,8 +648,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 */ diff --git
> a/drivers/net/i40e/base/i40e_nvm.c b/drivers/net/i40e/base/i40e_nvm.c
> index 67e58cc195..f385042601 100644
> --- a/drivers/net/i40e/base/i40e_nvm.c
> +++ b/drivers/net/i40e/base/i40e_nvm.c
> @@ -755,10 +755,11 @@ enum i40e_status_code
> i40e_update_nvm_checksum(struct i40e_hw *hw)
>  	DEBUGFUNC("i40e_update_nvm_checksum");
> 
>  	ret_code = i40e_calc_nvm_checksum(hw, &checksum);
> -	le_sum = CPU_TO_LE16(checksum);
> -	if (ret_code == I40E_SUCCESS)
> +	if (ret_code == I40E_SUCCESS) {
> +		le_sum = CPU_TO_LE16(checksum);
>  		ret_code = i40e_write_nvm_aq(hw, 0x00,
> I40E_SR_SW_CHECKSUM_WORD,
>  					     1, &le_sum, true);
> +	}
> 
>  	return ret_code;
>  }
> --
> 2.25.1


  reply	other threads:[~2021-06-21  6:52 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210618063851.3694702-1-robinx.zhang@intel.com>
2021-06-18  6:38 ` [dpdk-stable] [PATCH 06/14] net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters Robin Zhang
2021-06-18  6:38 ` [dpdk-stable] [PATCH 07/14] net/i40e/base: fix PF reset failed Robin Zhang
2021-06-18  6:38 ` [dpdk-stable] [PATCH 08/14] net/i40e/base: fix update link data for X722 Robin Zhang
2021-06-18  6:38 ` [dpdk-stable] [PATCH 09/14] net/i40e/base: fix AOC media type reported by ethtool Robin Zhang
2021-06-18  6:38 ` [dpdk-stable] [PATCH 12/14] net/i40e/base: fix headers to match functions Robin Zhang
2021-06-18  6:38 ` [dpdk-stable] [PATCH 13/14] net/i40e/base: fix potentially uninitialized variables in NVM code Robin Zhang
2021-06-21  6:52   ` Xing, Beilei [this message]
     [not found] ` <20210621063708.4014937-1-robinx.zhang@intel.com>
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 06/14] net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters Robin Zhang
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 07/14] net/i40e/base: fix PF reset failed Robin Zhang
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 08/14] net/i40e/base: fix update link data for X722 Robin Zhang
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 09/14] net/i40e/base: fix AOC media type reported by ethtool Robin Zhang
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 12/14] net/i40e/base: fix headers to match functions Robin Zhang
2021-06-21  6:37   ` [dpdk-stable] [PATCH v2 13/14] net/i40e/base: fix potentially uninitialized variables in NVM code Robin Zhang
     [not found] ` <20210621075206.4020456-1-robinx.zhang@intel.com>
2021-06-21  7:51   ` [dpdk-stable] [PATCH v3 06/15] net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters Robin Zhang
2021-06-21  7:51   ` [dpdk-stable] [PATCH v3 07/15] net/i40e/base: fix PF reset failed Robin Zhang
2021-06-21  7:51   ` [dpdk-stable] [PATCH v3 08/15] net/i40e/base: fix update link data for X722 Robin Zhang
2021-06-21  7:52   ` [dpdk-stable] [PATCH v3 09/15] net/i40e/base: fix AOC media type reported by ethtool Robin Zhang
2021-06-21  7:52   ` [dpdk-stable] [PATCH v3 12/15] net/i40e/base: fix headers to match functions Robin Zhang
2021-06-21  7:52   ` [dpdk-stable] [PATCH v3 13/15] net/i40e/base: fix potentially uninitialized variables in NVM code Robin Zhang
2021-06-21  7:52   ` [dpdk-stable] [PATCH v3 14/15] net/i40e/base: fix checksum is used before return value is checked Robin Zhang
     [not found] ` <20210906020258.1291688-1-robinx.zhang@intel.com>
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 05/18] net/i40e/base: fix PHY type identifiers for 2.5G and 5G adapters Robin Zhang
2021-09-29 16:21     ` Ferruh Yigit
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 06/18] net/i40e/base: fix PF reset failed Robin Zhang
2021-09-29 16:21     ` Ferruh Yigit
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 07/18] net/i40e/base: fix update link data for X722 Robin Zhang
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 08/18] net/i40e/base: fix AOC media type reported by ethtool Robin Zhang
2021-09-29 16:21     ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 10/18] net/i40e/base: fix headers to match functions Robin Zhang
2021-09-29 15:59     ` [dpdk-stable] [dpdk-dev] " Ferruh Yigit
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 11/18] net/i40e/base: fix potentially uninitialized variables in NVM code Robin Zhang
2021-09-06  2:02   ` [dpdk-stable] [PATCH v4 12/18] net/i40e/base: fix checksum is used before return value is checked Robin Zhang
     [not found] ` <20211009012648.64838-1-robinx.zhang@intel.com>
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 05/17] net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 06/17] net/i40e/base: fix PF reset Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 07/17] net/i40e/base: fix update link data for X722 Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 08/17] net/i40e/base: fix AOC media type Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 10/17] net/i40e/base: fix headers to match functions Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 11/17] net/i40e/base: fix potentially uninitialized variables Robin Zhang
2021-10-09  1:26   ` [dpdk-stable] [PATCH v5 12/17] net/i40e/base: fix checksum is used incorrectly Robin Zhang
     [not found] ` <20211009013956.70937-1-robinx.zhang@intel.com>
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 05/17] net/i40e/base: fix PHY identifiers for 2.5G and 5G adapters Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 06/17] net/i40e/base: fix PF reset Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 07/17] net/i40e/base: fix update link data for X722 Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 08/17] net/i40e/base: fix AOC media type Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 10/17] net/i40e/base: fix headers to match functions Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 11/17] net/i40e/base: fix potentially uninitialized variables Robin Zhang
2021-10-09  1:39   ` [dpdk-stable] [PATCH v6 12/17] net/i40e/base: fix checksum is used incorrectly 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=MN2PR11MB3807A93B5358AE3F31E534B9F70A9@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=christopher.pau@intel.com \
    --cc=dev@dpdk.org \
    --cc=junfeng.guo@intel.com \
    --cc=robinx.zhang@intel.com \
    --cc=stable@dpdk.org \
    --cc=stevex.yang@intel.com \
    /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).