소스 검색

crypto: jitterentropy - Delete unnecessary checks before the function call "kzfree"

The kzfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Markus Elfring 10 년 전
부모
커밋
cea0a3c305
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      crypto/jitterentropy.c

+ 2 - 4
crypto/jitterentropy.c

@@ -653,11 +653,9 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
 
 void jent_entropy_collector_free(struct rand_data *entropy_collector)
 {
-	if (entropy_collector->mem)
-		jent_zfree(entropy_collector->mem);
+	jent_zfree(entropy_collector->mem);
 	entropy_collector->mem = NULL;
-	if (entropy_collector)
-		jent_zfree(entropy_collector);
+	jent_zfree(entropy_collector);
 	entropy_collector = NULL;
 }