소스 검색

[NET]: Remove redundant NULL checks before [kv]free

Redundant NULL check before kfree removal
from net/

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Jesper Juhl 19 년 전
부모
커밋
63903ca6af
2개의 변경된 파일3개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 5
      net/ipv4/ipcomp.c
  2. 1 2
      net/tipc/name_distr.c

+ 2 - 5
net/ipv4/ipcomp.c

@@ -290,11 +290,8 @@ static void ipcomp_free_scratches(void)
 	if (!scratches)
 		return;
 
-	for_each_possible_cpu(i) {
-		void *scratch = *per_cpu_ptr(scratches, i);
-		if (scratch)
-			vfree(scratch);
-	}
+	for_each_possible_cpu(i)
+		vfree(*per_cpu_ptr(scratches, i));
 
 	free_percpu(scratches);
 }

+ 1 - 2
net/tipc/name_distr.c

@@ -229,8 +229,7 @@ static void node_is_down(struct publication *publ)
 				     publ->node, publ->ref, publ->key);
         assert(p == publ);
 	write_unlock_bh(&tipc_nametbl_lock);
-	if (publ)
-		kfree(publ);
+	kfree(publ);
 }
 
 /**