From b476e2951fcf7a25574b7b193944b041687f3ed4 Mon Sep 17 00:00:00 2001 From: Joonsoo Kim Date: Mon, 29 Apr 2013 15:08:53 -0700 Subject: mm, nobootmem: do memset() after memblock_reserve() Currently, we do memset() before reserving the area. This may not cause any problem, but it is somewhat weird. So change execution order. Signed-off-by: Joonsoo Kim Cc: Yinghai Lu Acked-by: Johannes Weiner Cc: Jiang Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/nobootmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mm/nobootmem.c') diff --git a/mm/nobootmem.c b/mm/nobootmem.c index a31be7a0493b..bdd3fa2fc73b 100644 --- a/mm/nobootmem.c +++ b/mm/nobootmem.c @@ -45,9 +45,9 @@ static void * __init __alloc_memory_core_early(int nid, u64 size, u64 align, if (!addr) return NULL; + memblock_reserve(addr, size); ptr = phys_to_virt(addr); memset(ptr, 0, size); - memblock_reserve(addr, size); /* * The min_count is set to 0 so that bootmem allocated blocks * are never reported as leaks. -- cgit v1.2.3