summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorChris Mi <cmi@nvidia.com>2021-05-06 11:40:34 +0800
committerSaeed Mahameed <saeedm@nvidia.com>2021-08-09 20:56:58 -0700
commit88bbd7b2369aca4598eb8f38c5f16be98c3bb5d4 (patch)
treed3d50c8f679601f8fe164a79e7cd3d3028b27173 /drivers/net
parentba317e832d457bc8fcecf6a6ed289732544b87e9 (diff)
net/mlx5e: TC, Fix error handling memory leak
Free the offload sample action on error. Fixes: f94d6389f6a8 ("net/mlx5e: TC, Add support to offload sample action") Signed-off-by: Chris Mi <cmi@nvidia.com> Reviewed-by: Oz Shlomo <ozsh@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c
index 794012c5c476..d3ad78aa9d45 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c
@@ -501,6 +501,7 @@ err_sampler:
err_offload_rule:
mlx5_esw_vporttbl_put(esw, &per_vport_tbl_attr);
err_default_tbl:
+ kfree(sample_flow);
return ERR_PTR(err);
}