diff -Naru a/include/linux/slab.h b/include/linux/slab.h
--- a/include/linux/slab.h	2006-04-10 00:16:10 -07:00
+++ b/include/linux/slab.h	2006-04-10 00:16:10 -07:00
@@ -97,6 +97,7 @@
 	return __kmalloc(size, flags);
 }
 
+extern void *kcalloc(size_t, size_t, int);
 extern void kfree(const void *);
 extern unsigned int ksize(const void *);
 
diff -Naru a/mm/slab.c b/mm/slab.c
--- a/mm/slab.c	2006-04-10 00:16:10 -07:00
+++ b/mm/slab.c	2006-04-10 00:16:10 -07:00
@@ -2435,6 +2435,27 @@
 EXPORT_SYMBOL(kmem_cache_free);
 
 /**
+ * kcalloc - allocate memory for an array. The memory is set to zero.
+ * @n: number of elements.
+ * @size: element size.
+ * @flags: the type of memory to allocate.
+ */
+void *kcalloc(size_t n, size_t size, int flags)
+{
+	void *ret = NULL;
+
+	if (n != 0 && size > INT_MAX / n)
+		return ret;
+
+	ret = kmalloc(n * size, flags);
+	if (ret)
+		memset(ret, 0, n * size);
+	return ret;
+}
+
+EXPORT_SYMBOL(kcalloc);
+
+/**
  * kfree - free previously allocated memory
  * @objp: pointer returned by kmalloc.
  *
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/07/01 17:28:18+02:00 perex@suse.cz 
#   This patch introduces a kcalloc() in the kernel that is used to
#   replace the ALSA subsystem-specific snd_kcalloc() and snd_magic_kcalloc().
#   
#   Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
# 
# include/linux/slab.h
#   2004/07/01 17:28:02+02:00 perex@suse.cz +1 -0
#   Added kcalloc()
# 
# mm/slab.c
#   2004/07/01 17:28:02+02:00 perex@suse.cz +21 -0
#   Added kcalloc() implementation.
# 
