Skip to content

Commit

Permalink
crypto: jitterentropy - Delete unnecessary checks before the function…
Browse files Browse the repository at this point in the history
… 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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
elfring authored and herbertx committed Jun 25, 2015
1 parent 338a9de commit cea0a3c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crypto/jitterentropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit cea0a3c

Please sign in to comment.