net/mlx5: fix wrong free function in HWS AGE info

Message ID 20221024132823.3246243-1-michaelba@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Raslan Darawsheh
Headers
Series net/mlx5: fix wrong free function in HWS AGE info |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation warning apply issues
ci/iol-testing warning apply patch failure

Commit Message

Michael Baum Oct. 24, 2022, 1:28 p.m. UTC
In AGE info initialization, the mlx5_hws_q_age_info structure is
allocated by "mlx5_malloc" function.

However, in case of failure, this structure is released by "rte_free".

This patch changes it to use "mlx5_free".

Fixes: 32c98171674f ("net/mlx5: add HWS AGE action support")
Cc: michaelba@nvidia.com

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/mlx5_hws_cnt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Raslan Darawsheh Oct. 24, 2022, 1:34 p.m. UTC | #1
Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Monday, October 24, 2022 4:28 PM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Michael
> Baum <michaelba@nvidia.com>
> Subject: [PATCH] net/mlx5: fix wrong free function in HWS AGE info
> 
> In AGE info initialization, the mlx5_hws_q_age_info structure is allocated by
> "mlx5_malloc" function.
> 
> However, in case of failure, this structure is released by "rte_free".
> 
> This patch changes it to use "mlx5_free".
> 
> Fixes: 32c98171674f ("net/mlx5: add HWS AGE action support")
> Cc: michaelba@nvidia.com
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch squashed into relevant commit in next-net-mlx,

Kindest regards,
Raslan Darawsheh
  

Patch

diff --git a/drivers/net/mlx5/mlx5_hws_cnt.c b/drivers/net/mlx5/mlx5_hws_cnt.c
index 9c37700f94..b8ce69af57 100644
--- a/drivers/net/mlx5/mlx5_hws_cnt.c
+++ b/drivers/net/mlx5/mlx5_hws_cnt.c
@@ -1100,7 +1100,7 @@  mlx5_hws_age_info_init(struct rte_eth_dev *dev, uint16_t nb_queues,
 	MLX5_ASSERT(strict_queue);
 	while (qidx--)
 		rte_ring_free(age_info->hw_q_age->aged_lists[qidx]);
-	rte_free(age_info->hw_q_age);
+	mlx5_free(age_info->hw_q_age);
 	return -1;
 }