From: Joonsoo Kim Date: Mon, 29 Apr 2013 22:08:53 +0000 (-0700) Subject: mm, nobootmem: do memset() after memblock_reserve() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b476e2951fcf7a25574b7b193944b041687f3ed4;p=openwrt%2Fstaging%2Fblogic.git 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 --- 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.