DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xing, Beilei" <beilei.xing@intel.com>
To: "Zhang, AlvinX" <alvinx.zhang@intel.com>,
	"Guo, Jia" <jia.guo@intel.com>,  "Xie, WeiX" <weix.xie@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Zhang, AlvinX" <alvinx.zhang@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix out-of-scope variable
Date: Mon, 18 Jan 2021 08:27:00 +0000	[thread overview]
Message-ID: <MN2PR11MB380729EBEADD79DC5F96EAE5F7A40@MN2PR11MB3807.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20210115083411.9324-1-alvinx.zhang@intel.com>



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Zhang,Alvin
> Sent: Friday, January 15, 2021 4:34 PM
> To: Guo, Jia <jia.guo@intel.com>; Xie, WeiX <weix.xie@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>
> Subject: [dpdk-dev] [PATCH v2] net/i40e: fix out-of-scope variable
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> Using "key", which points to an out-of-scope variable "rss_key_default".
> 
> Coverity issue: 365293
> Fixes: ef4c16fd9148 ("net/i40e: refactor RSS flow")
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
> 
> V2: Update the commit log.
> ---
>  drivers/net/i40e/i40e_hash.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_hash.c b/drivers/net/i40e/i40e_hash.c index
> e07f806..83a9af5 100644
> --- a/drivers/net/i40e/i40e_hash.c
> +++ b/drivers/net/i40e/i40e_hash.c
> @@ -901,10 +901,12 @@ struct i40e_hash_match_pattern {
>  			PMD_DRV_LOG(WARNING,
>  				    "RSS key length invalid, must be %u bytes,
> now set key to default",
>  				    (uint32_t)sizeof(rss_conf->key));
> -		key = (const uint8_t *)rss_key_default;
> +
> +		memcpy(rss_conf->key, rss_key_default, sizeof(rss_conf->key));
> +	} else {
> +		memcpy(rss_conf->key, key, sizeof(rss_conf->key));
>  	}
> 
> -	memcpy(rss_conf->key, key, sizeof(rss_conf->key));
>  	rss_conf->conf.key = rss_conf->key;
>  	rss_conf->conf.key_len = sizeof(rss_conf->key);  }
> --
> 1.8.3.1

Acked-by: Beilei Xing <beilei.xing@intel.com>


  reply	other threads:[~2021-01-18  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-14  6:52 [dpdk-dev] [PATCH] " Zhang,Alvin
2021-01-15  8:34 ` [dpdk-dev] [PATCH v2] " Zhang,Alvin
2021-01-18  8:27   ` Xing, Beilei [this message]
2021-01-19  3:47     ` Zhang, Qi Z

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=MN2PR11MB380729EBEADD79DC5F96EAE5F7A40@MN2PR11MB3807.namprd11.prod.outlook.com \
    --to=beilei.xing@intel.com \
    --cc=alvinx.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=jia.guo@intel.com \
    --cc=weix.xie@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).