[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>
Tento commit je obsažen v:
Pekka Enberg
2005-09-06 15:18:36 -07:00
odevzdal Linus Torvalds
rodič e915fc497a
revize 8db08ea7e6
3 změnil soubory, kde provedl 13 přidání a 5 odebrání

Zobrazit soubor

@@ -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)