Thread (4 messages) 4 messages, 4 authors, 2023-05-31

Re: [PATCH net-next] net/mlx5e: Remove a useless function call

From: Tariq Toukan <hidden>
Date: 2023-05-30 07:51:41
Also in: kernel-janitors, linux-rdma, lkml


On 29/05/2023 11:34, Christophe JAILLET wrote:
quoted hunk ↗ jump to hunk
'handle' is known to be NULL here. There is no need to kfree() it.

Signed-off-by: Christophe JAILLET <redacted>
---
  drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
index 0290e0dea539..4e923a2874ae 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c
@@ -112,10 +112,8 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *po
  	int err;
  
  	handle = kzalloc(sizeof(*handle), GFP_KERNEL);
-	if (!handle) {
-		kfree(handle);
+	if (!handle)
  		return ERR_PTR(-ENOMEM);
-	}
  
  	post_attr->chain = 0;
  	post_attr->prio = 0;
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks for your patch.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help