diff mbox series

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

Message ID fc535be629990acef5e2a3dfecd64a5f9661fd25.1685349266.git.christophe.jaillet@wanadoo.fr (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net/mlx5e: Remove a useless function call | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 3 maintainers not CCed: vladbu@nvidia.com roid@nvidia.com jianbol@nvidia.com
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Christophe JAILLET May 29, 2023, 8:34 a.m. UTC
'handle' is known to be NULL here. There is no need to kfree() it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Simon Horman May 30, 2023, 7:44 a.m. UTC | #1
On Mon, May 29, 2023 at 10:34:59AM +0200, Christophe JAILLET wrote:
> '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>
Tariq Toukan May 30, 2023, 7:51 a.m. UTC | #2
On 29/05/2023 11:34, Christophe JAILLET wrote:
> 'handle' is known to be NULL here. There is no need to kfree() it.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   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.
Saeed Mahameed May 31, 2023, 10:07 p.m. UTC | #3
On 29 May 10:34, Christophe JAILLET wrote:
>'handle' is known to be NULL here. There is no need to kfree() it.
>
>Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>


Applied to net-next-mlx5.

Thanks
diff mbox series

Patch

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;