aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/lib/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/lib/alloc.c')
-rw-r--r--arch/powerpc/lib/alloc.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/lib/alloc.c b/arch/powerpc/lib/alloc.c
index e58c80590eb..f53e09c7dac 100644
--- a/arch/powerpc/lib/alloc.c
+++ b/arch/powerpc/lib/alloc.c
@@ -2,6 +2,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/bootmem.h>
+#include <linux/string.h>
#include <asm/system.h>
@@ -12,3 +13,17 @@ void * __init_refok alloc_maybe_bootmem(size_t size, gfp_t mask)
else
return alloc_bootmem(size);
}
+
+void * __init_refok zalloc_maybe_bootmem(size_t size, gfp_t mask)
+{
+ void *p;
+
+ if (mem_init_done)
+ p = kzalloc(size, mask);
+ else {
+ p = alloc_bootmem(size);
+ if (p)
+ memset(p, 0, size);
+ }
+ return p;
+}