From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 67ECDA0A02; Sat, 27 Mar 2021 02:51:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A59340686; Sat, 27 Mar 2021 02:51:21 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id C67474067B for ; Sat, 27 Mar 2021 02:51:18 +0100 (CET) Received: from DGGEML403-HUB.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4F6hbR2NWMzYPW7; Sat, 27 Mar 2021 09:49:23 +0800 (CST) Received: from dggpemm100006.china.huawei.com (7.185.36.196) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sat, 27 Mar 2021 09:50:49 +0800 Received: from dggpemm500008.china.huawei.com (7.185.36.136) by dggpemm100006.china.huawei.com (7.185.36.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Sat, 27 Mar 2021 09:50:49 +0800 Received: from dggpemm500008.china.huawei.com ([7.185.36.136]) by dggpemm500008.china.huawei.com ([7.185.36.136]) with mapi id 15.01.2106.013; Sat, 27 Mar 2021 09:50:49 +0800 From: wangyunjian To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Shahaf Shuler , "Lilijun (Jerry)" , chenchanghu Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before null check Thread-Index: AQHXIiOfHbw9LS2vuUinAOmNG2XJv6qVvAqAgAFMAvA= Date: Sat, 27 Mar 2021 01:50:49 +0000 Message-ID: References: <8a980b235eeba49721dfef9d0f23be375e8958b0.1616741870.git.wangyunjian@huawei.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.151] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before null check X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Slava Ovsiienko [mailto:viacheslavo@nvidia.com] > Sent: Friday, March 26, 2021 9:24 PM > To: wangyunjian ; dev@dpdk.org > Cc: Matan Azrad ; Shahaf Shuler ; > Lilijun (Jerry) ; chenchanghu > > Subject: RE: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before nu= ll check >=20 > > -----Original Message----- > > From: wangyunjian > > Sent: Friday, March 26, 2021 12:37 > > To: dev@dpdk.org > > Cc: Matan Azrad ; Shahaf Shuler > > ; Slava Ovsiienko ; > > jerry.lilijun@huawei.com; chenchanghu@huawei.com; Yunjian Wang > > > > Subject: [dpdk-dev] [PATCH] net/mlx5: fix using flow tunnel before > > null check > > > > From: Yunjian Wang > > > > 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 > Acked-by: Viacheslav Ovsiienko >=20 > Thank you for the patch. I suppose, this one should be the part of 20.11L= TS > either. Could you, please, add "cc: stable@dpdk.org" and send v2? >=20 > With best regards, Slava OK, I will send v2 with it. Yunjian >=20 >=20 > > --- > > 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 =3D mlx5_flow_tunnel_allocate(dev, ctx->app_tunnel); > > - ctx->tunnel->refctn =3D 1; > > rte_spinlock_lock(&thub->sl); > > - if (ctx->tunnel) > > + if (ctx->tunnel) { > > + ctx->tunnel->refctn =3D 1; > > LIST_INSERT_HEAD(&thub->tunnels, ctx->tunnel, chain); > > + } > > } > > > > > > -- > > 2.23.0