From 7a7787bfb9c776da1a2597f5f723846d004de78d Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Tue, 6 Apr 2010 04:24:31 +0200 Subject: set memory allocated by ddekit_large_malloc to zero --- libdde_linux26/lib/src/arch/l4/kmalloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3