aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody P Schafer <[email protected]>2013-02-22 16:35:25 -0800
committerLinus Torvalds <[email protected]>2013-02-23 17:50:20 -0800
commitd29bb9782d22063892e28716cdb76a87d2876ddb (patch)
tree48c533b522cf65528c14ecfd2e7de7760badb192
parent2a6e3ebee2edcade56f836390a5f0c7b76ff5f9e (diff)
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 <[email protected]> Cc: David Hansen <[email protected]> Cc: Catalin Marinas <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Mel Gorman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/page_alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a3687afc5917..9614aabee8c5 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;