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 A4B75457A1 for ; Mon, 12 Aug 2024 14:56:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F7254066E; Mon, 12 Aug 2024 14:56:04 +0200 (CEST) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2076.outbound.protection.outlook.com [40.107.212.76]) by mails.dpdk.org (Postfix) with ESMTP id 0349340668 for ; Mon, 12 Aug 2024 14:56:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=wZMpRpHQVtJ0aDqPeXOpMsMu1kC4LRe96+9tPAWJH5PiI2RBZcTs9cCCQ7k6+iADHjQogQCVZTG3e1auXeg0SSLMuylCrTqhOAMt3QWCPDnLJH3lEyr/1H69hvrrkGWfX5EHu9UzJAGeySb1xZqAQ8t3vvxUtuJrLQWy0dfRVuhB/Bx8umJZcFSnw0s/R44kqHUFVdiFNgCit5Cf+wHb1ln9Eh+Sm25NshxK3LmK4xUODqj3sLQQaPdwoTTcDFBBIX/GEzpCARFJNZb4jPGWtf/GLzSaccn/ITE/kMSd9XM+SEWbiLknzwJtCLlaJ3oLIUwQSh/su037QOeQuMCMxA== 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=v5j5+nEAC6L6yo9Y+P6jfkyZC+zofZKTVm4zjE7fzOs=; b=PefidON8heOSddBjawOX7o4z7+3m/ggUpaxQJ2dQHvO0GvpjiqAeucgdgzMTGJQmsUIeugC+mtebXNbhYoJu6qF3j/7+XCbdliC+3L1BuG/qPFsuCJpGJKcwM8JuFjSyKEwuVEs5kyzXDXNCtaDv+eKs78tv5KDwl+xBCvtMkfGaZaB21grFbs2MODXI+0o2mXwr9k5Cah9ECZF5ZdJzoQtDwR+UUlFUb1aTcbm3jw+9RS2kQc0oxQlwdYwgdEfm3h4IS53xAxdSCft+9TC1fHWB45bw4/GkrWNlijrHRaSAKlGh1jfgeXKK9W2im4YwOsQxq1U9khUYl5mTMQf88A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=intel.com 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=v5j5+nEAC6L6yo9Y+P6jfkyZC+zofZKTVm4zjE7fzOs=; b=UmvJfLegAeGzNdWQ968Iq+wTJaMibNvIpxdlT1iJ9ZAnoNRJjKL0ZanpPmT9bi6AfEP55WeJOYOLQsaB7vypNQCnliIZG3Nc190bVLlEfKZQHWRU0gM/chq3PpkRW8SPnpfQlDeV3FbAVoTdi9q+r81WxwK2uRRy0eDsPdrGsxNgtmIRRcDelxxvQtMqRYWZ4j9pKV490bmjc5JSHZzgbJF6E9+yszWdiuDBl8aIVZ/E6NS/PH0EJMm4K2EH74acrsSbtBnrWujUCUAvbXvsHgdprj7NKOd8iv0msdRe558CTWk2fZodNVzXleWZG2lZGWZiBxklN0YGswN8WC7pDg== Received: from SA0PR11CA0051.namprd11.prod.outlook.com (2603:10b6:806:d0::26) by SN7PR12MB6932.namprd12.prod.outlook.com (2603:10b6:806:260::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Mon, 12 Aug 2024 12:55:58 +0000 Received: from SA2PEPF00003F68.namprd04.prod.outlook.com (2603:10b6:806:d0:cafe::e6) by SA0PR11CA0051.outlook.office365.com (2603:10b6:806:d0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.33 via Frontend Transport; Mon, 12 Aug 2024 12:55:58 +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 SA2PEPF00003F68.mail.protection.outlook.com (10.167.248.43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Mon, 12 Aug 2024 12:55:58 +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; Mon, 12 Aug 2024 05:55:47 -0700 Received: from nvidia.com (10.126.230.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; Mon, 12 Aug 2024 05:55:44 -0700 From: Xueming Li To: Fabio Pricoco CC: , Ian Stokes , Bruce Richardson , dpdk stable Subject: patch 'net/ice/base: fix resource leak' has been queued to stable release 23.11.2 Date: Mon, 12 Aug 2024 20:48:50 +0800 Message-ID: <20240812125035.389667-54-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240812125035.389667-1-xuemingl@nvidia.com> References: <20240712110153.309690-23-xuemingl@nvidia.com> <20240812125035.389667-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.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: SA2PEPF00003F68:EE_|SN7PR12MB6932:EE_ X-MS-Office365-Filtering-Correlation-Id: 29926b57-ab54-4777-ad50-08dcbace1c9f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|82310400026|1800799024|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?wOIK/I/aieooX3zdZ0veS3arvMaygEBeM3/8pSUGxnXkOTFM1XrB8ZQJ4OtR?= =?us-ascii?Q?fTOBkL3ul/kPXWdAFErSg8C4p+UJJb+dPqa/Obd1vXMzOJMQlWlyndL8UruR?= =?us-ascii?Q?37Nqi+C4Wbp5cn3ULoe30DojVXxVbqVMhMs8d+wdLoxQwwN/3oDngs8O0FAC?= =?us-ascii?Q?Rkv34PpML/yCV4egRmA4ffY0/JmuNuZgyKpYYApyMaSRpsGnZSUwsolYCYmi?= =?us-ascii?Q?3pyO+Bbh7SlOrxAfTOjYEsBjmDojeGUGwAQcS56gijlU9OYJ46kv0SMgdwgN?= =?us-ascii?Q?Yxshz2N/zV89q7xIL8BWj1j2966J+Km4eqW/qohY1oBeGDOiV6H7Btti1cGA?= =?us-ascii?Q?r7LCHiym2SGvh4O5NBXbJOoBHtn4gKNYDFRV8pxu87v+wlf2OvvqKGsg0rCi?= =?us-ascii?Q?oN3b2DbJToWz10yjWGXw9BmKAcNho+t+t6CrafF5cECsblLGSYlZsBh5zqfX?= =?us-ascii?Q?cb7EPSwZ6o/+YxjOE0C3eLdr3dQvSE8nMK54EubJjY++GrB5wBG/ix0G7Vah?= =?us-ascii?Q?7lrCE6OtpEkrDFRD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qk8+?= =?us-ascii?Q?bkdVBxXbftKjYfLqktm1qXSb047VLyBT?= 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)(82310400026)(1800799024)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Aug 2024 12:55:58.4617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29926b57-ab54-4777-ad50-08dcbace1c9f 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: SA2PEPF00003F68.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6932 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.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 08/14/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=2458257e56ecddc177bff0cbb93f9028e819c3fe Thanks. Xueming Li --- >From 2458257e56ecddc177bff0cbb93f9028e819c3fe Mon Sep 17 00:00:00 2001 From: Fabio Pricoco Date: Wed, 26 Jun 2024 12:40:57 +0100 Subject: [PATCH] net/ice/base: fix resource leak Cc: Xueming Li [ upstream commit e2072ba1b039a92f0f405a9533237a15404ef3a1 ] When errors happen during OROM reads, the allocated buffer is not freed. Fix it by adding a goto label to free the buffer in case of error. Fixes: ac882a0eda69 ("net/ice/base: store NVM version in extracted format") Signed-off-by: Fabio Pricoco Signed-off-by: Ian Stokes Acked-by: Bruce Richardson --- drivers/net/ice/base/ice_nvm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/base/ice_nvm.c b/drivers/net/ice/base/ice_nvm.c index e46aded12a..c112d3a27e 100644 --- a/drivers/net/ice/base/ice_nvm.c +++ b/drivers/net/ice/base/ice_nvm.c @@ -749,7 +749,7 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, orom_data, hw->flash.banks.orom_size); if (status) { ice_debug(hw, ICE_DBG_NVM, "Unable to read Option ROM data\n"); - return status; + goto exit_error;; } /* Scan the memory buffer to locate the CIVD data section */ @@ -773,7 +773,8 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, if (sum) { ice_debug(hw, ICE_DBG_NVM, "Found CIVD data with invalid checksum of %u\n", sum); - goto err_invalid_checksum; + status = ICE_ERR_NVM; + goto exit_error; } *civd = *tmp; @@ -781,11 +782,12 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, return ICE_SUCCESS; } + status = ICE_ERR_NVM; ice_debug(hw, ICE_DBG_NVM, "Unable to locate CIVD data within the Option ROM\n"); -err_invalid_checksum: +exit_error: ice_free(hw, orom_data); - return ICE_ERR_NVM; + return status; } /** -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-08-12 20:44:04.303305057 +0800 +++ 0053-net-ice-base-fix-resource-leak.patch 2024-08-12 20:44:02.075069291 +0800 @@ -1 +1 @@ -From e2072ba1b039a92f0f405a9533237a15404ef3a1 Mon Sep 17 00:00:00 2001 +From 2458257e56ecddc177bff0cbb93f9028e819c3fe Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit e2072ba1b039a92f0f405a9533237a15404ef3a1 ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -20 +22 @@ -index 9cebe7a07b..55e624cb31 100644 +index e46aded12a..c112d3a27e 100644 @@ -23 +25 @@ -@@ -748,7 +748,7 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, +@@ -749,7 +749,7 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, @@ -32 +34 @@ -@@ -772,7 +772,8 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, +@@ -773,7 +773,8 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, @@ -42,2 +44,2 @@ -@@ -780,11 +781,12 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, - return 0; +@@ -781,11 +782,12 @@ ice_get_orom_civd_data(struct ice_hw *hw, enum ice_bank_select bank, + return ICE_SUCCESS;