提交 cea0a3c3 编写于 作者: M Markus Elfring 提交者: Herbert Xu

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: NMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 338a9de0
...@@ -653,11 +653,9 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr, ...@@ -653,11 +653,9 @@ struct rand_data *jent_entropy_collector_alloc(unsigned int osr,
void jent_entropy_collector_free(struct rand_data *entropy_collector) 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; entropy_collector->mem = NULL;
if (entropy_collector) jent_zfree(entropy_collector);
jent_zfree(entropy_collector);
entropy_collector = NULL; entropy_collector = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册