]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm/memblock: pass size instead of end to memblock_set_node()
authorWei Yang <richard.weiyang@gmail.com>
Tue, 18 Mar 2025 07:19:46 +0000 (07:19 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:43:51 +0000 (09:43 +0200)
commit 06eaa824fd239edd1eab2754f29b2d03da313003 upstream.

The second parameter of memblock_set_node() is size instead of end.

Since it iterates from lower address to higher address, finally the node
id is correct. But during the process, some of them are wrong.

Pass size instead of end.

Fixes: 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()")
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Mike Rapoport <rppt@kernel.org>
CC: Yajun Deng <yajun.deng@linux.dev>
CC: stable@vger.kernel.org
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Link: https://lore.kernel.org/r/20250318071948.23854-2-richard.weiyang@gmail.com
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mm/memblock.c

index e8a2a1537d6a858c73d7bf1065137bb37ae50d85..a592ad619b2a66a82797ea2146f7b2547f3177cb 100644 (file)
@@ -2135,7 +2135,7 @@ static void __init memmap_init_reserved_pages(void)
                if (memblock_is_nomap(region))
                        reserve_bootmem_region(start, end, nid);
 
-               memblock_set_node(start, end, &memblock.reserved, nid);
+               memblock_set_node(start, region->size, &memblock.reserved, nid);
        }
 
        /* initialize struct pages for the reserved regions */