summaryrefslogtreecommitdiffstats
path: root/crypto/api.c
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@cmpxchg.org>2009-03-29 15:20:48 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2009-06-02 14:04:11 +1000
commit811d8f062668077e268a7292202bb923fe2ae896 (patch)
treecf6cb5da9d4f887ac7380e91851586199b5f8e94 /crypto/api.c
parent376bacb0a26bca722981d1610ffb76f951572bb1 (diff)
downloadlinux-811d8f062668077e268a7292202bb923fe2ae896.tar.bz2
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>
Diffstat (limited to 'crypto/api.c')
-rw-r--r--crypto/api.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/crypto/api.c b/crypto/api.c
index fd2545decb28..f500fb840be9 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -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);