summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorPekka Enberg <penberg@cs.helsinki.fi>2005-09-06 15:18:36 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-07 16:57:46 -0700
commit8db08ea7e6527eff82d8e45507468003e3cefba3 (patch)
tree604c0607e3767b1801e2547a3f0f2a06aebe92c4 /sound/core
parente915fc497a8da551f32b7e5fda687eb4a10bc23b (diff)
downloadop-kernel-dev-8db08ea7e6527eff82d8e45507468003e3cefba3.zip
op-kernel-dev-8db08ea7e6527eff82d8e45507468003e3cefba3.tar.gz
[PATCH] ALSA: convert kcalloc to kzalloc
This patch introduces a memory-leak tracking version of kzalloc for ALSA. Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Jaroslav Kysela <perex@suse.cz> Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/memory.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sound/core/memory.c b/sound/core/memory.c
index 1622893..291b476 100644
--- a/sound/core/memory.c
+++ b/sound/core/memory.c
@@ -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)
OpenPOWER on IntegriCloud