Skip to content

Commit c12c3e1

Browse files
committed
memblock: reserve_mem: fix end caclulation in reserve_mem_release_by_name()
free_reserved_area() expects end parameter to point to the first address after the area, but reserve_mem_release_by_name() passes it the last address inside the area. Remove subtraction of one in calculation of the area end. Fixes: 74e2498 ("mm/memblock: Add reserved memory release function") Link: https://patch.msgid.link/20260323074836.3653702-2-rppt@kernel.org Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
1 parent 8b7b853 commit c12c3e1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/memblock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2460,7 +2460,7 @@ int reserve_mem_release_by_name(const char *name)
24602460
return 0;
24612461

24622462
start = phys_to_virt(map->start);
2463-
end = start + map->size - 1;
2463+
end = start + map->size;
24642464
snprintf(buf, sizeof(buf), "reserve_mem:%s", name);
24652465
free_reserved_area(start, end, 0, buf);
24662466
map->size = 0;

0 commit comments

Comments
 (0)