diff --git a/mm/mm_init.c b/mm/mm_init.c index 4c17a892924d..01ced0553ce9 100644 --- a/mm/mm_init.c +++ b/mm/mm_init.c @@ -1142,6 +1142,8 @@ void __ref memmap_init_zone_device(struct zone *zone, if (!nr_pages) return; + VM_WARN_ON(!IS_ALIGNED(start_pfn | nr_pages, pfns_per_compound)); + /* * Seed the reusable head-page template from the first real struct * page. The normal page-init and refcount helpers must operate on