diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 1c7d90f7a84ac6013dddf45b1efe2afd1b7deccc..a88cb0cbf3526b1cb962e033505d87ef39bcb588 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -2842,11 +2842,7 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order, nopage: warn_alloc_failed(gfp_mask, order, NULL); - return page; got_pg: - if (kmemcheck_enabled) - kmemcheck_pagealloc_alloc(page, order, gfp_mask); - return page; } @@ -2916,6 +2912,9 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, preferred_zone, classzone_idx, migratetype); } + if (kmemcheck_enabled && page) + kmemcheck_pagealloc_alloc(page, order, gfp_mask); + trace_mm_page_alloc(page, order, alloc_mask, migratetype); out: