Commit 811d8f06 authored by Johannes Weiner's avatar Johannes Weiner Committed by Herbert Xu

crypto: api - Use kzfree

Use kzfree() instead of memset() + kfree().
Signed-off-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
Reviewed-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 376bacb0
......@@ -580,20 +580,17 @@ EXPORT_SYMBOL_GPL(crypto_alloc_tfm);
void crypto_destroy_tfm(void *mem, struct crypto_tfm *tfm)
{
struct crypto_alg *alg;
int size;
if (unlikely(!mem))
return;
alg = tfm->__crt_alg;
size = ksize(mem);
if (!tfm->exit && alg->cra_exit)
alg->cra_exit(tfm);
crypto_exit_ops(tfm);
crypto_mod_put(alg);
memset(mem, 0, size);
kfree(mem);
kzfree(mem);
}
EXPORT_SYMBOL_GPL(crypto_destroy_tfm);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment