[78/82] graph: remove unnecessary NULL checks

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Jan. 24, 2022, 12:05 a.m. UTC
  Remove redundant NULL pointer checks before free functions
found by nullfree.cocci

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

Patch

diff --git a/lib/graph/graph_stats.c b/lib/graph/graph_stats.c
index aa70929dc32e..65e12d46a313 100644
--- a/lib/graph/graph_stats.c
+++ b/lib/graph/graph_stats.c
@@ -233,8 +233,7 @@  cluster_add(struct cluster *cluster, struct graph *graph)
 static void
 cluster_fini(struct cluster *cluster)
 {
-	if (cluster->graphs)
-		free(cluster->graphs);
+	free(cluster->graphs);
 }
 
 static int