[PATCH 22.11] net/mlx5: fix testpmd crash by action template

Rongwei Liu rongweil at nvidia.com
Mon Mar 6 10:15:26 CET 2023


When action template creation fails the testpmd expects error
details.
The driver did not set the error structure and testpmd failed with a
segmentation fault.

Fixes: 836b5c9b5e0e ("net/mlx5: add action template management")
Cc: stable at dpdk.org
Signed-off-by: Rongwei Liu <rongweil at nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo at nvidia.com>
---
 drivers/net/mlx5/mlx5_flow_hw.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c
index b4a80f977f..9e5f263ccf 100644
--- a/drivers/net/mlx5/mlx5_flow_hw.c
+++ b/drivers/net/mlx5/mlx5_flow_hw.c
@@ -4946,6 +4950,9 @@ flow_hw_actions_template_create(struct rte_eth_dev *dev,
 			mlx5dr_action_template_destroy(at->tmpl);
 		mlx5_free(at);
 	}
+	rte_flow_error_set(error, rte_errno,
+			   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+			   "Failed to create action template");
 	return NULL;
 }
-- 
2.27.0



More information about the stable mailing list