summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Da <zhengda1936@gmail.com>2010-04-06 04:24:31 +0200
committerZheng Da <zhengda1936@gmail.com>2010-04-06 04:24:31 +0200
commit7a7787bfb9c776da1a2597f5f723846d004de78d (patch)
tree1a5c930179e49482ba291600f189074d578f5480
parentd6efe4a3a6ef60582d11afe166831c84d11d9d75 (diff)
set memory allocated by ddekit_large_malloc to zero
-rw-r--r--libdde_linux26/lib/src/arch/l4/kmalloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libdde_linux26/lib/src/arch/l4/kmalloc.c b/libdde_linux26/lib/src/arch/l4/kmalloc.c
index 87d64878..0e94fb97 100644
--- a/libdde_linux26/lib/src/arch/l4/kmalloc.c
+++ b/libdde_linux26/lib/src/arch/l4/kmalloc.c
@@ -134,9 +134,12 @@ void *__kmalloc(size_t size, gfp_t flags)
if (cache)
/* allocate from cache */
p = kmem_cache_alloc(cache, flags);
- else
+ else {
/* no cache for this size - use ddekit malloc */
p = ddekit_large_malloc(size);
+ if (flags & __GFP_ZERO)
+ memset (p, 0, size);
+ }
ddekit_log(DEBUG_MALLOC, "size=%d, cache=%p (%d) => %p",
size, cache, cache ? kmem_cache_size(cache) : 0, p);