mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm: Fix memory size alignment in devm_memremap_pages_release()
The functions devm_memremap_pages() and devm_memremap_pages_release() use
different ways to calculate the section-aligned amount of memory. The
latter function may use an incorrect size if the memory region is small
but straddles a section border.
Use the same code for both.
Cc: <[email protected]>
Fixes: 5f29a77cd9 ("mm: fix mixed zone detection in devm_memremap_pages")
Signed-off-by: Jan H. Schönherr <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
e697c5b90e
commit
10a0cd6e49
1 changed files with 2 additions and 1 deletions
|
|
@ -293,7 +293,8 @@ static void devm_memremap_pages_release(void *data)
|
|||
|
||||
/* pages are dead and unused, undo the arch mapping */
|
||||
align_start = res->start & ~(SECTION_SIZE - 1);
|
||||
align_size = ALIGN(resource_size(res), SECTION_SIZE);
|
||||
align_size = ALIGN(res->start + resource_size(res), SECTION_SIZE)
|
||||
- align_start;
|
||||
|
||||
mem_hotplug_begin();
|
||||
arch_remove_memory(align_start, align_size, pgmap->altmap_valid ?
|
||||
|
|
|
|||
Loading…
Reference in a new issue