2022-04-22 15:27:55

by baihaowen

[permalink] [raw]
Subject: [PATCH] net/mlx5: Remove useless kfree

After alloc fail, we do not need to kfree.

Signed-off-by: Haowen Bai <[email protected]>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
index e49f51124c74..89aa0208b5d2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c
@@ -1812,7 +1812,6 @@ __mlx5_tc_ct_flow_offload(struct mlx5_tc_ct_priv *ct_priv,

ct_flow = kzalloc(sizeof(*ct_flow), GFP_KERNEL);
if (!ct_flow) {
- kfree(ct_flow);
return ERR_PTR(-ENOMEM);
}

--
2.7.4


2022-04-27 10:10:06

by Saeed Mahameed

[permalink] [raw]
Subject: Re: [PATCH] net/mlx5: Remove useless kfree

On 22 Apr 14:08, Haowen Bai wrote:
>After alloc fail, we do not need to kfree.
>
>Signed-off-by: Haowen Bai <[email protected]>
applied to net-next-mlx5, thanks!