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 E219745E41 for ; Sat, 7 Dec 2024 09:07:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D802040E34; Sat, 7 Dec 2024 09:07:47 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2070.outbound.protection.outlook.com [40.107.100.70]) by mails.dpdk.org (Postfix) with ESMTP id 6349540613 for ; Sat, 7 Dec 2024 09:07:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MSXAnDQ2ZjBRFqZu4dg5Y+0j9sTjHfb/mioKYrkBU7ILmvcFn/Kjn2ktwNY1kvxC/lD2VxxVwXReF1E70hsQfkOxfZuG+IPjvNAza71Ht7bVrDQWwKqv21MretZATsHXHzr/ZHRR7ItjUkgC4iy6JrOVeVotoynGbAIP5TdDh9SgQu9MdASCbKzMSolK/revsHRPRRfJ3bZMn9E17rg1eUKoQTBDvEWYCkJuY4J5i+vunzVmwjJ0ykchJZXxa72HJWpPJDq/zkzWfvz7aCxjej7P7JJmRJVv3HSHA9DdWAiNkxI8AKki13ObwEqpdflsYg62NUgwdCbTqTdGQhwlGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=FqxCY92T2pI6FcWhD/cwqgc0rclnYzYzCjdXnqx0LJ0=; b=wys7Cg4Ukd1DlNuTgXqS7alcln/WpA04/N1OmPifB9U7uitkd/dBxgE4ZLgK5uEOGpk1IOiiBKyT/NLCrXBUmhd/Ucslwb+SnucVyfidkWh/hqYPjWb7z+BlW54afop1iaz9Zy46cHx8Zy3aabAn/PjbWK/ryuKbPuggRZ7aJGKfEGKFuaJm9LWMLKrkPUItcU2Z+5VwB5/VF+MedPzGoSkkXAtIGY+jFMoTtjFmXmAlPllzNWIvfqjKFknPAsHAB1HrcE8gn6ljeioZLHV3e3VGfsR6waKZaRPgz2/WZextRJLVyrBl52FEW8QBEYQUfMR6hLTkqLKmJTnH1zwNuA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=networkplumber.org 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=FqxCY92T2pI6FcWhD/cwqgc0rclnYzYzCjdXnqx0LJ0=; b=bqcC2b8zoQK+FTXSEZdo9H4P0ffP3VZgNkb+2ABe2ybUzJ4OoSBFDg59vdwZGWTYHQENQ4EtwulnjMglFWnAamt6wTW9yesu4iM1epC5kJAY3db3bBTf5X13R0ID3HjXaIxQDLvZ1fbU6jbtrLv3Tes847dIVr6uOSVm1m2ivt0t8NBM4e5kkH8nsP7WojioJga5buI2GDPWk6Wsicao8I3ONInGeqPmU3GK/8MWEQjHyxzSub3q6o3TNr5QVDXGIYJtYPPD9Y8JUjZT6507spNnPnCviODK8OL7S9EB7St4h+a/wUnHnz35UJPFweM/gGXQ5CASuCnQyxo3woGTvQ== Received: from BLAPR03CA0018.namprd03.prod.outlook.com (2603:10b6:208:32b::23) by BL1PR12MB5804.namprd12.prod.outlook.com (2603:10b6:208:394::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.19; Sat, 7 Dec 2024 08:07:42 +0000 Received: from BL02EPF00021F68.namprd02.prod.outlook.com (2603:10b6:208:32b:cafe::f1) by BLAPR03CA0018.outlook.office365.com (2603:10b6:208:32b::23) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8230.12 via Frontend Transport; Sat, 7 Dec 2024 08:07:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) 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.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by BL02EPF00021F68.mail.protection.outlook.com (10.167.249.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8230.7 via Frontend Transport; Sat, 7 Dec 2024 08:07:42 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:07:25 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Sat, 7 Dec 2024 00:07:24 -0800 From: Xueming Li To: Stephen Hemminger CC: Xueming Li , Ferruh Yigit , dpdk stable Subject: patch 'net/dpaa2: remove unnecessary check for null before free' has been queued to stable release 23.11.3 Date: Sat, 7 Dec 2024 16:00:24 +0800 Message-ID: <20241207080055.488538-67-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241207080055.488538-1-xuemingl@nvidia.com> References: <20241111062847.216344-122-xuemingl@nvidia.com> <20241207080055.488538-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F68:EE_|BL1PR12MB5804:EE_ X-MS-Office365-Filtering-Correlation-Id: ddaa48b4-8606-4994-aff0-08dd1696398c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|82310400026|36860700013|7053199007; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?sTq0vN31xWOW9e44cSe/4omHwVrx+RiAWx4C/F5ryvP2KkWXJx/cRlD2LuXN?= =?us-ascii?Q?gjcjYfvKlFrpNsf860WkwnyI3dkW/TIV77a8DWDbiKFAAW8XcLst4AVG9WKG?= =?us-ascii?Q?FakBbcYJK9FNg0y9fWprDqH/TWj85irxZos46Ss1JF3riJriEn2aqZnr25Dx?= =?us-ascii?Q?kvP0d8ZxzSS4kMayw1hbAmjabvhvE7Oz62eSOixGLHdYfFKypqyPmmvVciD+?= =?us-ascii?Q?SgI3hf+jUDdDBzrvc8ha0BpML4CV/wwRAO7xPELhe+0pY0w+p5ESYsBl8Npw?= =?us-ascii?Q?S7UFuG3/rhJardBGqysP53d9/q+kxSFx3PI4xbJ3m29QGZGLGBV8zBEjhYSG?= =?us-ascii?Q?KAgdmsIMUkkt6Vs4JwWqRIo92W9hvNlTA/tO47RBxhpjhYe6XdoXlqxKM/Pr?= =?us-ascii?Q?5AhBR4+q9pwrgvV3xXjPwA0CAv5A/j55VZiiW4pBGKPJ9pnzrcJOsNCUHQYE?= =?us-ascii?Q?mJUmu2I2+qWCYq3gXNG1NwKb8Vjq28eO+wWKc3GC/iqXz1FEn++Y2ZgSccuI?= =?us-ascii?Q?yWU9R/PkxpmlesTjkiQ5em20x7OTo7nv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ascii?Q?mR4wL+KdvrUEMzMwa1HO88d/iuiKaBFr?= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230040)(1800799024)(376014)(82310400026)(36860700013)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2024 08:07:42.0717 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ddaa48b4-8606-4994-aff0-08dd1696398c X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF00021F68.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5804 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.3 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=ea2df1d74f8adc168f548f8bf1f4dab38681168c Thanks. Xueming Li --- >From ea2df1d74f8adc168f548f8bf1f4dab38681168c Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 12 Nov 2024 09:38:02 -0800 Subject: [PATCH] net/dpaa2: remove unnecessary check for null before free Cc: Xueming Li [ upstream commit e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c ] Calling rte_free() with NULL parameter is allowed. Found by nullfree.cocci Fixes: 5964d36a2904 ("net/dpaa2: release port upon close") Signed-off-by: Stephen Hemminger Acked-by: Ferruh Yigit --- drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index c5b1f161fd..873121524f 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1390,8 +1390,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) for (i = 0; i < MAX_TCS; i++) rte_free((void *)(size_t)priv->extract.tc_extract_param[i]); - if (priv->extract.qos_extract_param) - rte_free((void *)(size_t)priv->extract.qos_extract_param); + rte_free((void *)(size_t)priv->extract.qos_extract_param); DPAA2_PMD_INFO("%s: netdev deleted", dev->data->name); return 0; -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-12-06 23:26:46.260792702 +0800 +++ 0066-net-dpaa2-remove-unnecessary-check-for-null-before-f.patch 2024-12-06 23:26:43.983044827 +0800 @@ -1 +1 @@ -From e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c Mon Sep 17 00:00:00 2001 +From ea2df1d74f8adc168f548f8bf1f4dab38681168c Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -15,4 +17,2 @@ - drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- - drivers/net/dpaa2/dpaa2_flow.c | 27 +++++++++------------------ - drivers/net/dpaa2/dpaa2_mux.c | 6 ++---- - 3 files changed, 12 insertions(+), 24 deletions(-) + drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) @@ -21 +21 @@ -index 8cbe481fb5..a9bce854c3 100644 +index c5b1f161fd..873121524f 100644 @@ -24 +24 @@ -@@ -1401,8 +1401,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) +@@ -1390,8 +1390,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) @@ -26 +26 @@ - rte_free(priv->extract.tc_extract_param[i]); + rte_free((void *)(size_t)priv->extract.tc_extract_param[i]); @@ -29,2 +29,2 @@ -- rte_free(priv->extract.qos_extract_param); -+ rte_free(priv->extract.qos_extract_param); +- rte_free((void *)(size_t)priv->extract.qos_extract_param); ++ rte_free((void *)(size_t)priv->extract.qos_extract_param); @@ -34,69 +33,0 @@ -diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c -index de850ae0cf..c94eb51ba5 100644 ---- a/drivers/net/dpaa2/dpaa2_flow.c -+++ b/drivers/net/dpaa2/dpaa2_flow.c -@@ -4784,8 +4784,7 @@ end_flow_set: - } - } - -- if (dpaa2_pattern) -- rte_free(dpaa2_pattern); -+ rte_free(dpaa2_pattern); - - return ret; - } -@@ -5057,14 +5056,10 @@ mem_failure: - - creation_error: - if (flow) { -- if (flow->qos_key_addr) -- rte_free(flow->qos_key_addr); -- if (flow->qos_mask_addr) -- rte_free(flow->qos_mask_addr); -- if (flow->fs_key_addr) -- rte_free(flow->fs_key_addr); -- if (flow->fs_mask_addr) -- rte_free(flow->fs_mask_addr); -+ rte_free(flow->qos_key_addr); -+ rte_free(flow->qos_mask_addr); -+ rte_free(flow->fs_key_addr); -+ rte_free(flow->fs_mask_addr); - rte_free(flow); - } - priv->curr = NULL; -@@ -5128,14 +5123,10 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow, - } - - LIST_REMOVE(flow, next); -- if (flow->qos_key_addr) -- rte_free(flow->qos_key_addr); -- if (flow->qos_mask_addr) -- rte_free(flow->qos_mask_addr); -- if (flow->fs_key_addr) -- rte_free(flow->fs_key_addr); -- if (flow->fs_mask_addr) -- rte_free(flow->fs_mask_addr); -+ rte_free(flow->qos_key_addr); -+ rte_free(flow->qos_mask_addr); -+ rte_free(flow->fs_key_addr); -+ rte_free(flow->fs_mask_addr); - /* Now free the flow */ - rte_free(flow); - -diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c -index e9d48a81a8..2f124313fa 100644 ---- a/drivers/net/dpaa2/dpaa2_mux.c -+++ b/drivers/net/dpaa2/dpaa2_mux.c -@@ -329,10 +329,8 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, - } - - creation_error: -- if (key_cfg_va) -- rte_free(key_cfg_va); -- if (key_va) -- rte_free(key_va); -+ rte_free(key_cfg_va); -+ rte_free(key_va); - - return ret; - }