patch 'net/ice/base: fix memory leak in firmware version check' has been queued to stable release 22.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 15 17:26:23 CEST 2024


Hi,

FYI, your patch has been queued to stable release 22.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/17/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://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/64f49919dd07cb0b6d70c32703f0afb61de44139

Thanks.

Luca Boccassi

---
>From 64f49919dd07cb0b6d70c32703f0afb61de44139 Mon Sep 17 00:00:00 2001
From: Eric Joyner <eric.joyner at intel.com>
Date: Tue, 25 Jun 2024 12:12:25 +0100
Subject: [PATCH] net/ice/base: fix memory leak in firmware version check

[ upstream commit 6b75956aacc081d56a36ab8f82c530832b288c01 ]

If ice_cfg_phy_fec() goes through case ICE_FEC_DIS_AUTO but the
underlying device firmware isn't the correct version, then the memory
used to hold the PHY capabilities output from the firmware isn't freed.

Fix this by making sure the memory is freed by jumping to the label that
frees the memory instead of returning from the version check
immediately.

Fixes: 4b6ede113f55 ("net/ice/base: support auto FEC with FEC disabled")

Signed-off-by: Eric Joyner <eric.joyner at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/ice/base/ice_common.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index a327a4b374..ac67411ebd 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -3803,8 +3803,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
 		break;
 	case ICE_FEC_DIS_AUTO:
 		/* Set No FEC and auto FEC */
-		if (!ice_fw_supports_fec_dis_auto(hw))
-			return ICE_ERR_NOT_SUPPORTED;
+		if (!ice_fw_supports_fec_dis_auto(hw)) {
+			status = ICE_ERR_NOT_SUPPORTED;
+			goto out;
+		}
 		cfg->link_fec_opt |= ICE_AQC_PHY_FEC_DIS;
 		/* fall-through */
 	case ICE_FEC_AUTO:
-- 
2.39.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2024-07-15 16:19:36.916273769 +0100
+++ 0045-net-ice-base-fix-memory-leak-in-firmware-version-che.patch	2024-07-15 16:19:34.576206634 +0100
@@ -1 +1 @@
-From 6b75956aacc081d56a36ab8f82c530832b288c01 Mon Sep 17 00:00:00 2001
+From 64f49919dd07cb0b6d70c32703f0afb61de44139 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 6b75956aacc081d56a36ab8f82c530832b288c01 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index 3d787d2a29..ef6696cddf 100644
+index a327a4b374..ac67411ebd 100644
@@ -28 +29 @@
-@@ -3843,8 +3843,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,
+@@ -3803,8 +3803,10 @@ ice_cfg_phy_fec(struct ice_port_info *pi, struct ice_aqc_set_phy_cfg_data *cfg,


More information about the stable mailing list