diff options
| author | Joonsoo Kim <iamjoonsoo.kim@lge.com> | 2013-04-29 18:08:53 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 18:54:39 -0400 |
| commit | b476e2951fcf7a25574b7b193944b041687f3ed4 (patch) | |
| tree | 8870e141ca8acbf58cf0b8b470e30b6dbb4a32d2 | |
| parent | b4def3509d18c1db9198f92d4c35065e029a09a1 (diff) | |
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 <iamjoonsoo.kim@lge.com>
Cc: Yinghai Lu <yinghai@kernel.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jiang Liu <liuj97@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
| -rw-r--r-- | mm/nobootmem.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, | |||
| 45 | if (!addr) | 45 | if (!addr) |
| 46 | return NULL; | 46 | return NULL; |
| 47 | 47 | ||
| 48 | memblock_reserve(addr, size); | ||
| 48 | ptr = phys_to_virt(addr); | 49 | ptr = phys_to_virt(addr); |
| 49 | memset(ptr, 0, size); | 50 | memset(ptr, 0, size); |
| 50 | memblock_reserve(addr, size); | ||
| 51 | /* | 51 | /* |
| 52 | * The min_count is set to 0 so that bootmem allocated blocks | 52 | * The min_count is set to 0 so that bootmem allocated blocks |
| 53 | * are never reported as leaks. | 53 | * are never reported as leaks. |
