diff mbox series

[3/5] net/mlx5: fix ASO age pools resize error flow

Message ID 1605080208-12165-3-git-send-email-michaelba@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers show
Series [1/5] net/mlx5: fix unused calculation in RSS expansion | expand


Context Check Description
ci/checkpatch success coding style OK

Commit Message

Michael Baum Nov. 11, 2020, 7:36 a.m. UTC
In ASO age pools resize, the PMD starts ASO data-path.

When starting ASO data-path is failed, the pools memory was not freed
what caused a memory leak.

Free it.

Fixes: f935ed4b645a ("net/mlx5: support flow hit action for aging")

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
 drivers/net/mlx5/mlx5_flow_dv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series


diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 78c710f..8214c59 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -9347,8 +9347,10 @@  struct mlx5_cache_entry *
 		/* First ASO flow hit allocation - starting ASO data-path. */
 		int ret = mlx5_aso_queue_start(priv->sh);
-		if (ret)
+		if (ret) {
+			mlx5_free(pools);
 			return ret;
+		}
 	mng->n = resize;
 	mng->pools = pools;