]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - mm/page_alloc.c
checkpatch: improve --git <commit-count> shortcut
[karo-tx-linux.git] / mm / page_alloc.c
index 2dd1ba4e70cc8fa59eaae5c27d34520488299837..f8f3bfc435eec5bf0144798f6b890e6deacee0f6 100644 (file)
@@ -522,12 +522,6 @@ static void bad_page(struct page *page, const char *reason,
        static unsigned long nr_shown;
        static unsigned long nr_unshown;
 
-       /* Don't complain about poisoned pages */
-       if (PageHWPoison(page)) {
-               page_mapcount_reset(page); /* remove PageBuddy */
-               return;
-       }
-
        /*
         * Allow a burst of 60 reports, then keep quiet for that minute;
         * or allow a steady drip of one report per second.
@@ -993,7 +987,6 @@ static __always_inline bool free_pages_prepare(struct page *page,
 
        trace_mm_page_free(page, order);
        kmemcheck_free_shadow(page, order);
-       kasan_free_pages(page, order);
 
        /*
         * Check tail pages before head page information is cleared to
@@ -1035,6 +1028,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
        arch_free_page(page, order);
        kernel_poison_pages(page, 1 << order, 0);
        kernel_map_pages(page, 1 << order, 0);
+       kasan_free_pages(page, order);
 
        return true;
 }
@@ -1654,6 +1648,9 @@ static void check_new_page_bad(struct page *page)
        if (unlikely(page->flags & __PG_HWPOISON)) {
                bad_reason = "HWPoisoned (hardware-corrupted)";
                bad_flags = __PG_HWPOISON;
+               /* Don't complain about hwpoisoned pages */
+               page_mapcount_reset(page); /* remove PageBuddy */
+               return;
        }
        if (unlikely(page->flags & PAGE_FLAGS_CHECK_AT_PREP)) {
                bad_reason = "PAGE_FLAGS_CHECK_AT_PREP flag set";