From fb399b4854d2159a4d23fbfbd7daaed914fd54fa Mon Sep 17 00:00:00 2001 From: zijun_hu Date: Thu, 28 Jul 2016 15:48:56 -0700 Subject: [PATCH] mm/memblock.c: fix index adjustment error in __next_mem_range_rev() Fix region index adjustment error when parameter type_b of __next_mem_range_rev() == NULL. Signed-off-by: zijun_hu Cc: Alexander Kuleshov Cc: Ard Biesheuvel Cc: Tang Chen Cc: Wei Yang Cc: Tang Chen Cc: Richard Leitner Cc: David Gibson Cc: Tejun Heo Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memblock.c b/mm/memblock.c index 4884a162e3ad..ff5ff3b5f1ea 100644 --- a/mm/memblock.c +++ b/mm/memblock.c @@ -1027,7 +1027,7 @@ void __init_memblock __next_mem_range_rev(u64 *idx, int nid, ulong flags, *out_end = m_end; if (out_nid) *out_nid = m_nid; - idx_a++; + idx_a--; *idx = (u32)idx_a | (u64)idx_b << 32; return; } -- 2.20.1