DPDK patches and discussions
 help / color / mirror / Atom feed
From: Slava Ovsiienko <viacheslavo@nvidia.com>
To: wangyunjian <wangyunjian@huawei.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	"jerry.lilijun@huawei.com" <jerry.lilijun@huawei.com>,
	"chenchanghu@huawei.com" <chenchanghu@huawei.com>
Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before null check
Date: Fri, 26 Mar 2021 13:23:31 +0000
Message-ID: <DM6PR12MB375361C166DE267F728E8A6BDF619@DM6PR12MB3753.namprd12.prod.outlook.com> (raw)
In-Reply-To: <8a980b235eeba49721dfef9d0f23be375e8958b0.1616741870.git.wangyunjian@huawei.com>

> -----Original Message-----
> From: wangyunjian <wangyunjian@huawei.com>
> Sent: Friday, March 26, 2021 12:37
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Shahaf Shuler
> <shahafs@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>;
> jerry.lilijun@huawei.com; chenchanghu@huawei.com; Yunjian Wang
> <wangyunjian@huawei.com>
> Subject: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before null
> check
> 
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Coverity flags that 'ctx->tunnel' variable is used before it's checked for NULL.
> This patch fixes this issue.
> 
> Coverity issue: 366201
> Fixes: 868d2e342cf3 ("net/mlx5: fix tunnel offload hub multi-thread
> protection")
> 
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>

Thank you for the patch. I suppose, this one should be the part of 20.11LTS
either. Could you, please, add "cc: stable@dpdk.org" and send v2?

With best regards, Slava


> ---
>  drivers/net/mlx5/mlx5_flow.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
> index d46fc333d1..bb8d09cdef 100644
> --- a/drivers/net/mlx5/mlx5_flow.c
> +++ b/drivers/net/mlx5/mlx5_flow.c
> @@ -7899,10 +7899,11 @@ static void get_tunnel_miss(struct rte_eth_dev
> *dev, void *x)
> 
>  	rte_spinlock_unlock(&thub->sl);
>  	ctx->tunnel = mlx5_flow_tunnel_allocate(dev, ctx->app_tunnel);
> -	ctx->tunnel->refctn = 1;
>  	rte_spinlock_lock(&thub->sl);
> -	if (ctx->tunnel)
> +	if (ctx->tunnel) {
> +		ctx->tunnel->refctn = 1;
>  		LIST_INSERT_HEAD(&thub->tunnels, ctx->tunnel, chain);
> +	}
>  }
> 
> 
> --
> 2.23.0


  reply	other threads:[~2021-03-26 13:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  9:37 wangyunjian
2021-03-26 13:23 ` Slava Ovsiienko [this message]
2021-03-27  1:50   ` wangyunjian
2021-03-27  2:44 ` [dpdk-dev] [PATCH v2] " wangyunjian
2021-03-28 11:39   ` Raslan Darawsheh

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=DM6PR12MB375361C166DE267F728E8A6BDF619@DM6PR12MB3753.namprd12.prod.outlook.com \
    --to=viacheslavo@nvidia.com \
    --cc=chenchanghu@huawei.com \
    --cc=dev@dpdk.org \
    --cc=jerry.lilijun@huawei.com \
    --cc=matan@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=wangyunjian@huawei.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git