Merge tag 'wireless-drivers-for-davem-2015-02-11' of git://git.kernel.org/pub/scm...
[linux-2.6-microblaze.git] / mm / page_alloc.c
index 8e20f9c..f121050 100644 (file)
@@ -552,17 +552,15 @@ static inline int page_is_buddy(struct page *page, struct page *buddy,
                return 0;
 
        if (page_is_guard(buddy) && page_order(buddy) == order) {
-               VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy);
-
                if (page_zone_id(page) != page_zone_id(buddy))
                        return 0;
 
+               VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy);
+
                return 1;
        }
 
        if (PageBuddy(buddy) && page_order(buddy) == order) {
-               VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy);
-
                /*
                 * zone check is done late to avoid uselessly
                 * calculating zone/node ids for pages that could
@@ -571,6 +569,8 @@ static inline int page_is_buddy(struct page *page, struct page *buddy,
                if (page_zone_id(page) != page_zone_id(buddy))
                        return 0;
 
+               VM_BUG_ON_PAGE(page_count(buddy) != 0, buddy);
+
                return 1;
        }
        return 0;