diff mbox series

[v2,58/83] net/mlx5: remove unnecessary NULL checks

Message ID 20220124174719.14417-59-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers show
Series remove unnecessary null checks | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 5:46 p.m. UTC
Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mlx5/mlx5_flow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Slava Ovsiienko Jan. 26, 2022, 7 a.m. UTC | #1
> -----Original Message-----
> From: Stephen Hemminger <stephen@networkplumber.org>
> Sent: Monday, January 24, 2022 19:47
> To: dev@dpdk.org
> Cc: Stephen Hemminger <stephen@networkplumber.org>; Matan Azrad
> <matan@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>
> Subject: [PATCH v2 58/83] net/mlx5: remove unnecessary NULL checks
> 
> Remove redundant NULL pointer checks before free functions found by
> nullfree.cocci
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
diff mbox series

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index b7cf4143d5a1..c718dbdb3dc7 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -6990,8 +6990,7 @@  flow_alloc_thread_workspace(void)
 	data->rssq_num = MLX5_RSSQ_DEFAULT_NUM;
 	return data;
 err:
-	if (data->rss_desc.queue)
-		free(data->rss_desc.queue);
+	free(data->rss_desc.queue);
 	free(data);
 	return NULL;
 }