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 38093455B6; Sun, 7 Jul 2024 12:25:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2989C40658; Sun, 7 Jul 2024 12:25:55 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2048.outbound.protection.outlook.com [40.107.223.48]) by mails.dpdk.org (Postfix) with ESMTP id 527AC4029F for ; Sun, 7 Jul 2024 12:25:53 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0WmYLO+7NhuMbXRp9ctbc3zlIIK9qv2o0wBLTE1YqkNZEie8xwnJGol4dvOlOSbTMo1FlaZkpQKORoQQy5gtz3/QVqSga1f8bSEQktdU6zPUVd9nzqdoyPn6Sz9HJHdpxIgWtOViXrNgbhNXkhrA37bnXQFdT6IGgYw9e8LgsUrIOHR/QyhUlCjYy7202zfviBhcDPV9D/H+kfobHl3zFiOCfFjUbVN2iGxw6YOlQrvLTydJ0UTv1r44jVO6FOrBmd891gtgNDHj79Gm5E3iAkjXCUIZ8I07wtJnwxuD+bFOecfGddlkHfNCwWYM2t2gTLHPvQjOp/rxikWOMpNvw== 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=Z0uPj1A1Pt9tCu88xKuMK7quNtVwxTtsHMH805vxelc=; b=k0N5+d/nFAFx1Z8urZa06HUtdlHMv923wTZFqyT9VC8WHt+u40ZpOZg6YuS5TzfHYuhckrMM/ylau9m6wgBP06oE1DeGD4oO0h9qMKt1yN+lVTKp71+bp1YffHLBQHzOXtTIE7vUETlhK1Rcv76Hp0XNpDrWExjanKWxbM2Rj/v1fZ4T/Y7x+VlBGIhBRkfqtSJPIlakDbtCCN4oks1XeldMBwmxG8eiH9Z0On2EbJdvrIV2HTUNHVVFlvthYWaauJWruyCt3UMVjjIBu7NqzZ6QoUDoVVW81KPNPYBy/4RCzlNkzK5NcT5AHanN9fHwwlIA1MKk5v8l0DnSJTPhuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=monjalon.net smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none (0) 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=Z0uPj1A1Pt9tCu88xKuMK7quNtVwxTtsHMH805vxelc=; b=DLksixNsbIKN3bwLZiHIn+cTrPEHzLrI0bH87Kowf+9bhoWnuwYkotRLFn/YSPf463vkiWLE/Nj8EHfGeJ/WeMa2sTf/FtFRKhCfGNTNNpRql9VIS3cMatHAXf3fzhQcHdgH41XqJbZWVETxy5uXV1s5vZjQOp+JGFyYjQjPgmCgs9+VfsUtQNiGuoLlbEdAuCOVQmamGAyK14UBoZ8qA45MevMdwHADtlXGRRQs/Xen6jC5a5sFd48PKdaVGCOIyDd+HrNbneh1g5V5IaHbCqJoPVURQnRrsQFOL6VtcCE5WXYMQC+4yr2Z3C2w01VRARmljoV0V7PFUzY/DLgndA== Received: from BL1PR13CA0208.namprd13.prod.outlook.com (2603:10b6:208:2be::33) by MN2PR12MB4173.namprd12.prod.outlook.com (2603:10b6:208:1d8::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.34; Sun, 7 Jul 2024 10:25:49 +0000 Received: from BL6PEPF0001AB53.namprd02.prod.outlook.com (2603:10b6:208:2be:cafe::df) by BL1PR13CA0208.outlook.office365.com (2603:10b6:208:2be::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:49 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by BL6PEPF0001AB53.mail.protection.outlook.com (10.167.241.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.17 via Frontend Transport; Sun, 7 Jul 2024 10:25:49 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:46 -0700 Received: from drhqmail201.nvidia.com (10.126.190.180) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sun, 7 Jul 2024 03:25:46 -0700 Received: from nvidia.com (10.127.8.12) by mail.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4 via Frontend Transport; Sun, 7 Jul 2024 03:25:42 -0700 From: Itamar Gozlan To: , , , , , , , , Dariusz Sosnowski , Bing Zhao , Ori Kam , Matan Azrad , Maayan Kashani CC: , Mahmoud Maatuq Subject: [PATCH 02/10] net/mlx5: fix matcher object memory leak Date: Sun, 7 Jul 2024 13:25:23 +0300 Message-ID: <20240707102532.2045942-2-igozlan@nvidia.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20240707102532.2045942-1-igozlan@nvidia.com> References: <20240707102532.2045942-1-igozlan@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0001AB53:EE_|MN2PR12MB4173:EE_ X-MS-Office365-Filtering-Correlation-Id: 57527ec1-5376-4114-a66b-08dc9e6f2be0 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?glyTCmUKXd7CkgKDJ14Q9/8fKzfILQTmc5PZMWwITeeJEn3U5gmR8vBk1e/2?= =?us-ascii?Q?PLBOzUK6MtXk3T0XnVsyVW9OF+meGWnnQrMe8BiwFcpjZfhA06+j63SRZWoU?= =?us-ascii?Q?wqbzNpq9Z1HY8TzFCEX8icaflQAdzWOtWjsVNjZJa/gZ0LFnFWFs6mFYLtER?= =?us-ascii?Q?QFNQaxeEGQ+PxYModwsHAbSvmMYbV0UkpecouITgfvvCUPHbGMOoLr69hkev?= =?us-ascii?Q?tKXkJVKpcxShRheUcTGTyWduf1xtRNN6ZQu/M/rzJyKbKhjw6WZgVxPQSYP2?= =?us-ascii?Q?HMMiSvS0i/O0LO+aDLQVsYHuXU7LwDXWVsR6wANCnkhFax7G7YG2r5RoIcLU?= =?us-ascii?Q?vUfqj6yXatq1B7X5KRW0PFz+Z04LWtei2ybRzCrQ1Ky0mzkTtLPAowdyXywM?= =?us-ascii?Q?TsnOwwzDJfjPbUNwV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?= =?us-ascii?Q?mord6MGT/SUSdGwCf24AnOSK6jW6Wnnd/1t8e3CggN7907/yVMnN0QzbF+jQ?= =?us-ascii?Q?nEv9Q54L8PIFvASdBc0hdzhNhYz9QRsgABZTGEzeEyNN+yntJ083iQd08iqK?= =?us-ascii?Q?XOqZjyA+FQV7cAL+2iSrVRzHrN6O9mEkooY6w1fvhONvBqFZHypWLA=3D=3D?= X-Forefront-Antispam-Report: CIP:216.228.118.232; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc7edge1.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(921020); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2024 10:25:49.2594 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 57527ec1-5376-4114-a66b-08dc9e6f2be0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.118.232]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0001AB53.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4173 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 From: Mahmoud Maatuq This makes sure that the allocated matcher object is freed for all branches that return NULL. Coverity issue: 426424 Fixes: 27d171b88031 ("net/mlx5: abstract flow action and enable reconfigure") Signed-off-by: Mahmoud Maatuq Acked-by: Bing Zhao Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/mlx5_flow_dv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index d46beffd4c..8a0d58cb05 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 = *((const struct rte_flow_item **)(ctx->data2)); resource->matcher_object = mlx5dr_bwc_matcher_create (resource->group->tbl, resource->priority, items); - if (!(resource->matcher_object)) + if (!resource->matcher_object) { + mlx5_free(resource); return NULL; + } #else + mlx5_free(resource); return NULL; #endif } -- 2.39.3