From 8db08ea7e6527eff82d8e45507468003e3cefba3 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Tue, 6 Sep 2005 15:18:36 -0700 Subject: [PATCH] ALSA: convert kcalloc to kzalloc This patch introduces a memory-leak tracking version of kzalloc for ALSA. Signed-off-by: Pekka Enberg Cc: Jaroslav Kysela Signed-off-by: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- sound/core/memory.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'sound/core/memory.c') 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) -- cgit v1.1