]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - mm/page_alloc.c
mm: fail GFP_DMA allocations when ZONE_DMA is not configured
[can-eth-gw-linux.git] / mm / page_alloc.c
index 01e6b614839d3be030658eed24fa05eb3268c540..10a8c6da385fc5dcae4105e4eeefe3440eabb91d 100644 (file)
@@ -2247,6 +2247,10 @@ __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order,
 
        if (should_fail_alloc_page(gfp_mask, order))
                return NULL;
+#ifndef CONFIG_ZONE_DMA
+       if (WARN_ON_ONCE(gfp_mask & __GFP_DMA))
+               return NULL;
+#endif
 
        /*
         * Check the zones suitable for the gfp_mask contain at least one