[PATCH v2] net/mlx5: fix the error set for age pool initialization

Bing Zhao bingz at nvidia.com
Fri Jun 30 12:26:49 CEST 2023


The rte_flow_error needs to be set when the age pool initialization
has a failure. Or else the application will crash due to the access
of the invalid "message" field.

Fixes: 04a4de756e14 ("net/mlx5: support flow age action with HWS")
Cc: michaelba at nvidia.com
Cc: stable at dpdk.org

Signed-off-by: Bing Zhao <bingz at nvidia.com>
Acked-by: Ori Kam <orika at nvidia.com>
---
v2: add CC stable
---
 drivers/net/mlx5/mlx5_flow_hw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index 4163fe23e6..20941b4fc7 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -7913,8 +7913,11 @@ flow_hw_configure(struct rte_eth_dev *dev,
 			goto err;
 		}
 		ret = mlx5_hws_age_pool_init(dev, port_attr, nb_queue);
-		if (ret < 0)
+		if (ret < 0) {
+			rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+					   NULL, "Failed to init age pool.");
 			goto err;
+		}
 	}
 	ret = flow_hw_create_vlan(dev);
 	if (ret)
-- 
2.34.1



More information about the stable mailing list