crypto: api - Use kzfree

Use kzfree() instead of memset() + kfree().

Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
Johannes Weiner 2009-03-29 15:20:48 +08:00 committed by Herbert Xu
parent 376bacb0a2
commit 811d8f0626
1 changed files with 1 additions and 4 deletions

View File

@ -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);