ALSA: hda/tas2781: call cleanup functions only once
[linux-2.6-microblaze.git] / crypto / jitterentropy-kcapi.c
index 7d1463a..76edbf8 100644 (file)
  * Helper function
  ***************************************************************************/
 
+void *jent_kvzalloc(unsigned int len)
+{
+       return kvzalloc(len, GFP_KERNEL);
+}
+
+void jent_kvzfree(void *ptr, unsigned int len)
+{
+       memzero_explicit(ptr, len);
+       kvfree(ptr);
+}
+
 void *jent_zalloc(unsigned int len)
 {
        return kzalloc(len, GFP_KERNEL);
@@ -245,7 +256,9 @@ static int jent_kcapi_init(struct crypto_tfm *tfm)
        crypto_shash_init(sdesc);
        rng->sdesc = sdesc;
 
-       rng->entropy_collector = jent_entropy_collector_alloc(1, 0, sdesc);
+       rng->entropy_collector =
+               jent_entropy_collector_alloc(CONFIG_CRYPTO_JITTERENTROPY_OSR, 0,
+                                            sdesc);
        if (!rng->entropy_collector) {
                ret = -ENOMEM;
                goto err;
@@ -334,7 +347,7 @@ static int __init jent_mod_init(void)
 
        desc->tfm = tfm;
        crypto_shash_init(desc);
-       ret = jent_entropy_init(desc);
+       ret = jent_entropy_init(CONFIG_CRYPTO_JITTERENTROPY_OSR, 0, desc, NULL);
        shash_desc_zero(desc);
        crypto_free_shash(tfm);
        if (ret) {