Skip to content

Commit

Permalink
net/mlx5: fix leak in HWS flow counter action
Browse files Browse the repository at this point in the history
This was caught by our internal covscan.
mp_name can be leaked in case of errors.

Fixes: 4d368e1 ("net/mlx5: support flow counter action for HWS")
Cc: [email protected]

Signed-off-by: David Marchand <[email protected]>
  • Loading branch information
david-marchand authored and raslandarawsheh committed Feb 10, 2025
1 parent 6c08078 commit 98f7f1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/mlx5/mlx5_hws_cnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
if (priv->sh->cnt_svc == NULL) {
ret = mlx5_hws_cnt_svc_init(priv->sh, error);
if (ret)
return ret;
goto error;
}
cparam.fetch_sz = HWS_CNT_CACHE_FETCH_DEFAULT;
cparam.preload_sz = HWS_CNT_CACHE_PRELOAD_DEFAULT;
Expand Down Expand Up @@ -767,6 +767,7 @@ mlx5_hws_cnt_pool_create(struct rte_eth_dev *dev,
MLX5_ASSERT(ret);
mlx5_hws_cnt_pool_destroy(priv->sh, cpool);
priv->hws_cpool = NULL;
mlx5_free(mp_name);
return ret;
}

Expand Down

0 comments on commit 98f7f1e

Please sign in to comment.