From: Cody P Schafer Date: Sat, 23 Feb 2013 00:35:25 +0000 (-0800) Subject: mm/page_alloc: add a VM_BUG in __free_one_page() if the zone is uninitialized. X-Git-Tag: upstream/snapshot3+hdmi~5668^2~34 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d29bb9782d22063892e28716cdb76a87d2876ddb;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.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 Signed-off-by: Linus Torvalds --- diff --git a/mm/page_alloc.c b/mm/page_alloc.c index a3687af..9614aab 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;