From: Cody P Schafer Date: Thu, 7 Feb 2013 01:27:05 +0000 (+1100) Subject: mm/page_alloc: add a VM_BUG in __free_one_page() if the zone is uninitialized. X-Git-Tag: next-20130218~1^2~332 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=9a7486f0d245aaa24f3b08f6e322d71ac96a7677;p=karo-tx-linux.git mm/page_alloc: add a VM_BUG in __free_one_page() if the zone is uninitialized. Freeing pages to uninitialized zones is not handled by __free_one_page(), and should never happen when the code is correct. Ran into this while writing some code that dynamically onlines extra zones. Signed-off-by: Cody P Schafer Cc: David Hansen Cc: Catalin Marinas Cc: Johannes Weiner Cc: Mel Gorman Signed-off-by: Andrew Morton --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c558decf6bac..cde32d2ffb9c 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -538,6 +538,8 @@ static inline void __free_one_page(struct page *page, unsigned long uninitialized_var(buddy_idx); struct page *buddy; + VM_BUG_ON(!zone_is_initialized(zone)); + if (unlikely(PageCompound(page))) if (unlikely(destroy_compound_page(page, order))) return;