net/mlx5e: Remove a useless function call
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 29 May 2023 08:34:59 +0000 (10:34 +0200)
committerSaeed Mahameed <saeedm@nvidia.com>
Sat, 10 Jun 2023 01:40:53 +0000 (18:40 -0700)
'handle' is known to be NULL here. There is no need to kfree() it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c

index 0290e0d..4e923a2 100644 (file)
@@ -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;