]> err.no Git - linux-2.6/blobdiff - sound/core/memory.c
[PATCH] ALSA: convert kcalloc to kzalloc
[linux-2.6] / sound / core / memory.c
index f6895577bf864bb9b715508fde30774af1b8d4cc..291b4769bde38f2bf2775958ce94f200e62f9732 100644 (file)
@@ -56,7 +56,7 @@ static DEFINE_SPINLOCK(snd_alloc_vmalloc_lock);
 #define VMALLOC_MAGIC 0x87654320
 static snd_info_entry_t *snd_memory_info_entry;
 
-void snd_memory_init(void)
+void __init snd_memory_init(void)
 {
        snd_alloc_kmalloc = 0;
        snd_alloc_vmalloc = 0;
@@ -116,15 +116,21 @@ void *snd_hidden_kmalloc(size_t size, unsigned int __nocast flags)
        return _snd_kmalloc(size, flags);
 }
 
+void *snd_hidden_kzalloc(size_t size, unsigned int __nocast flags)
+{
+       void *ret = _snd_kmalloc(size, flags);
+       if (ret)
+               memset(ret, 0, size);
+       return ret;
+}
+EXPORT_SYMBOL(snd_hidden_kzalloc);
+
 void *snd_hidden_kcalloc(size_t n, size_t size, unsigned int __nocast flags)
 {
        void *ret = NULL;
        if (n != 0 && size > INT_MAX / n)
                return ret;
-       ret = _snd_kmalloc(n * size, flags);
-       if (ret)
-               memset(ret, 0, n * size);
-       return ret;
+       return snd_hidden_kzalloc(n * size, flags);
 }
 
 void snd_hidden_kfree(const void *obj)