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 E0D2C454E1; Mon, 24 Jun 2024 15:59:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C1A6140B92; Mon, 24 Jun 2024 15:59:27 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2060.outbound.protection.outlook.com [40.107.212.60]) by mails.dpdk.org (Postfix) with ESMTP id 7180B402F0 for ; Mon, 24 Jun 2024 15:59:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dp1BEENvczAsmAEtn8/GCjSCWh+rR2l2rvTlBrGvMcVboX/gTbVwFgSmzcDeA2mylstWKErjIWkeRmRpHqB3KVwmdK4vCpSu8r2ECeTtorIjQeJL34sSBJl8cCxK0QYHgcHHkdVci88RG4TXKYTuGWmpMGNdswuTF0V/LkQN/DJmWAR+2YZlmef3Qkes8vKRed+Vl6FPbhJtyfygniYWNE9qBhjfWWQbIoLpE9GogaLLJADlGk2NOHtD4gdXJGEpeCEzfes0EdOlSawg57VSVrsvjDdbuPg9by6we2dKLlxBXwcWT56q4eVNp0owNZcFyMBsq2mVS/jnu4LCtsq3tA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KzkD4dEfOxMb3qMoo6B4+09HVjruC4Wt9wdqTn93U40=; b=T+vErO2Plb/otHyUO+qqcR0BdijcnKE4qW8fi2t592DbMOSVQOTveo7CmbvApQ/jL+Qg4vau5yDLy62blk0q5Pd4Ii3zbR1VDYaNVD/HIlN0+HsOeP390h9UKpz72cTvxQNHOe1tbZuLzEbdDtOW7smaaGAkuSe8tTHa5XCdDlMpo2CeRl+Dj1V7xVRTno8AyQ3wzH2+YbZvybzV4GD5iCnUGQ+BlTTeCVjQpNqMwD49A2PijFEvRTUQj4HbT3UK/F9dmoDDUl6M4TpqvAJ4HRtjfNmJYa6+TSUaegj9UGWxHHFHdgSjy4FxoTgB+tOxqNuONLyvIJTQTcW/ZDzo7w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KzkD4dEfOxMb3qMoo6B4+09HVjruC4Wt9wdqTn93U40=; b=Su24XIINDxpLFXrzqkwwB/pPZfCxXdQ79YEOkjNJuWViBaM26yHem0hjBSS+7k2rop88zQQxZz58p5TACO2q9xtpJQKu9Lo6opsIF2Cb7AFMUof53KLG6EfaG2UTDtTJ7vSvvdqCVZeonzbN+1seeKcb4kPS3rvPJkT3vbgvyNXpRGVwYjy63ZHgZsC3gph9gTsmCNhO608OiTvyuKtLRRQmm/wwt/o4+YJ8yQ3A08K3Q5yzBXM0r6TSNJfDebgkK7xnp2OU5/SA2S915nAfAqwKskzWp8muLplV+AvnK9j01tbknZMKo8osIQdcoXxD0/eMS+8kr83YfCNUul8Izg== Received: from PH0PR12MB8800.namprd12.prod.outlook.com (2603:10b6:510:26f::12) by SA3PR12MB8047.namprd12.prod.outlook.com (2603:10b6:806:31b::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.29; Mon, 24 Jun 2024 13:59:17 +0000 Received: from PH0PR12MB8800.namprd12.prod.outlook.com ([fe80::bdb6:e12f:18b6:2b77]) by PH0PR12MB8800.namprd12.prod.outlook.com ([fe80::bdb6:e12f:18b6:2b77%7]) with mapi id 15.20.7698.025; Mon, 24 Jun 2024 13:59:17 +0000 From: Dariusz Sosnowski To: Mahmoud Maatuq , Slava Ovsiienko , Bing Zhao , Ori Kam , Suanming Mou , Matan Azrad CC: "dev@dpdk.org" Subject: RE: [PATCH] net/mlx5: fix memleak for resource object Thread-Topic: [PATCH] net/mlx5: fix memleak for resource object Thread-Index: AQHaxVke69PbnkQgRk6wYiUeFiy8TrHW4cVw Date: Mon, 24 Jun 2024 13:59:17 +0000 Message-ID: References: <20240623103539.1690600-1-mahmoudmatook.mm@gmail.com> In-Reply-To: <20240623103539.1690600-1-mahmoudmatook.mm@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH0PR12MB8800:EE_|SA3PR12MB8047:EE_ x-ms-office365-filtering-correlation-id: 2ad5beb3-897e-484e-5493-08dc9455d6a8 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230037|376011|366013|1800799021|38070700015; x-microsoft-antispam-message-info: =?us-ascii?Q?eRy8tIgAAT77lt4hlAfXBzY+uvAB34eLJL33PHgkBH8IkIkDMWV/5T1VR4sP?= =?us-ascii?Q?v1JAACJQpz04Jy4XcUzGvgBnPsm6K9Mdk0HBIKZWWIRXXgkcyo0oR0B7wFRa?= =?us-ascii?Q?jthrZzC8moW3XnYMHSfK/GKp/LmFv9gbmln7Z18vnhrlh4MAz1eriiAQymPB?= =?us-ascii?Q?RbWF8YjIx/Bt1drKI5XDTw1qfuGchSG+NXiQ1iB60Ur8+2cJEV20uPg9+N9k?= =?us-ascii?Q?reGoBDqdLmdDNIoZVPCqz18PxSFNxdANm9NdT+DqQ1fxYPcZ02CMS6arLfuh?= =?us-ascii?Q?A+rY7a3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l3cYCxD1KnmWXK0Xrbf7+J8?= =?us-ascii?Q?lnBSIFJiYB8z8hT3WXulQpA5Gxc/4qHEnsiOEdyL0Ug9ztCN/ZuKUo/MMOOk?= =?us-ascii?Q?38Wwxp+45UqTGQifELUiFviYbq80c1c+GfEDA2la0gut2p24KkklJ+3DBjtQ?= =?us-ascii?Q?ERgkxkBD688D9e+kz9RqBHhOi1DT+auWZ8Zb/1YDPhZrFYrSJCMRYI+6NiVJ?= =?us-ascii?Q?8HuMfiw=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR12MB8800.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230037)(376011)(366013)(1800799021)(38070700015); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?80jnEOGOT2c0KT18FqAVbbxS47N/VrRbXvL//+ynUTMk4Qb/u0Kqpjd3H/rY?= =?us-ascii?Q?onnbt7IIb3p4+Deswge3fwNWhtSIGnPzTAMDg5XLxNLzGSVgD/8U5gK1jaDt?= =?us-ascii?Q?HyOyu3YKyuZaNWXLk74GfskEBf8voMYBIpcZJeWNK/crLIdEGEuCCLhvQJp7?= =?us-ascii?Q?VO9rnJ5s/OM0FBaWY8qdIQ0w0cw1fA5dj9jLrLR4JzjqDKEGRsEYVjBd3sES?= =?us-ascii?Q?lQpFvzq02PkEdRB1mXirGf5+8ZyY31Gczukvph+K6CpHhYUkEz2L1uReUxuo?= =?us-ascii?Q?xqB2gepfCIeSYrIVfVLAXzLlQqtseycpyvrEMEVjfXK3GSAIxI8OsJvlcY9Y?= =?us-ascii?Q?38C8NOtTrxrL+udP9oPbbSF2hKY9iSQbvmrNpOR8rbbbN8aH0HPFzeuWmQIi?= =?us-ascii?Q?ulGjm+tlIsoIEfWC7kppdDsrPQbUvaCrYbkz8Os5B6i9IWF6PVlDburEJ3a6?= =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z/4xgHc9BA4B/D2z0v+u8Nz?= =?us-ascii?Q?fYQzg2n86GPmLxfux+aMgeGmCCfqg62dPlByYqRZvn9nY1KZBfB4KK/d6fes?= =?us-ascii?Q?raqHWOmUO/ZQAxM3is5s4GQOj3VF/PX0Jwc7BkT3xnieBv/gqUUHwP0y2sl8?= =?us-ascii?Q?1KRSxGUMlwc/KaPGPT/Ud5Js3sUrK4QAzN5NucvTxuOu4bSvP5RMxF/07K4q?= =?us-ascii?Q?UOCdLXztP5boGW/c2aOSJrswTt1PVcftdUXXN+xk?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH0PR12MB8800.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2ad5beb3-897e-484e-5493-08dc9455d6a8 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jun 2024 13:59:17.3753 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: fORSFNRi5RaP1BaHgwSTWcSaGzawduhRVfWEK+RZiMqjQqzg6UOG5TYsoR6H+RQZo27wKk/QUt0ikDF8v057gw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB8047 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 Hi, Thank you very much for the fix. Could you please provide the commit message explaining the problem reported= by Coverity and the fix? > -----Original Message----- > From: Mahmoud Maatuq > Sent: Sunday, June 23, 2024 12:36 > To: Dariusz Sosnowski ; Slava Ovsiienko > ; Bing Zhao ; Ori Kam > ; Suanming Mou ; Matan Azrad > > Cc: dev@dpdk.org; Mahmoud Maatuq > Subject: [PATCH] net/mlx5: fix memleak for resource object >=20 > Coverity issue: 426424 > Fixes: e78e5408da89 ("net/mlx5: remove cache term from the list utility") The issue was introduced in commit 27d171b88031 ("net/mlx5: abstract flow a= ction and enable reconfigure"). Fixes tag should reference that commit. > Cc: matan@nvidia.com >=20 > Signed-off-by: Mahmoud Maatuq > --- > drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow= _dv.c > index d46beffd4c..1010b8e423 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -12010,9 +12010,12 @@ flow_matcher_create_cb(void *tool_ctx, void > *cb_ctx) > items =3D *((const struct rte_flow_item **)(ctx->data2)); > resource->matcher_object =3D mlx5dr_bwc_matcher_create > (resource->group->tbl, resource->priority= , items); > - if (!(resource->matcher_object)) > + if (!(resource->matcher_object)) { While we're at it, could you please remove the parentheses around resource-= >matcher_object? They're redundant. > + mlx5_free(resource); > return NULL; > + } > #else > + mlx5_free(resource); > return NULL; > #endif > } > -- > 2.43.0 Best regards, Dariusz Sosnowski