hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/powerpc/mm/init_64.c
....@@ -188,7 +188,7 @@
188188 unsigned long nr_pfn = page_size / sizeof(struct page);
189189 unsigned long start_pfn = page_to_pfn((struct page *)start);
190190
191
- if ((start_pfn + nr_pfn) > altmap->end_pfn)
191
+ if ((start_pfn + nr_pfn - 1) > altmap->end_pfn)
192192 return true;
193193
194194 if (start_pfn < altmap->base_pfn)
....@@ -313,8 +313,7 @@
313313 start = ALIGN_DOWN(start, page_size);
314314 if (altmap) {
315315 alt_start = altmap->base_pfn;
316
- alt_end = altmap->base_pfn + altmap->reserve +
317
- altmap->free + altmap->alloc + altmap->align;
316
+ alt_end = altmap->base_pfn + altmap->reserve + altmap->free;
318317 }
319318
320319 pr_debug("vmemmap_free %lx...%lx\n", start, end);