aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
Diffstat (limited to 'mm')
-rw-r--r--mm/kmemleak.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 58ec86c9e58a..25e203474d1b 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -109,6 +109,9 @@
109 109
110#define BYTES_PER_POINTER sizeof(void *) 110#define BYTES_PER_POINTER sizeof(void *)
111 111
112/* GFP bitmask for kmemleak internal allocations */
113#define GFP_KMEMLEAK_MASK (GFP_KERNEL | GFP_ATOMIC)
114
112/* scanning area inside a memory block */ 115/* scanning area inside a memory block */
113struct kmemleak_scan_area { 116struct kmemleak_scan_area {
114 struct hlist_node node; 117 struct hlist_node node;
@@ -462,7 +465,7 @@ static void create_object(unsigned long ptr, size_t size, int min_count,
462 struct prio_tree_node *node; 465 struct prio_tree_node *node;
463 struct stack_trace trace; 466 struct stack_trace trace;
464 467
465 object = kmem_cache_alloc(object_cache, gfp & ~GFP_SLAB_BUG_MASK); 468 object = kmem_cache_alloc(object_cache, gfp & GFP_KMEMLEAK_MASK);
466 if (!object) { 469 if (!object) {
467 kmemleak_panic("kmemleak: Cannot allocate a kmemleak_object " 470 kmemleak_panic("kmemleak: Cannot allocate a kmemleak_object "
468 "structure\n"); 471 "structure\n");
@@ -636,7 +639,7 @@ static void add_scan_area(unsigned long ptr, unsigned long offset,
636 return; 639 return;
637 } 640 }
638 641
639 area = kmem_cache_alloc(scan_area_cache, gfp & ~GFP_SLAB_BUG_MASK); 642 area = kmem_cache_alloc(scan_area_cache, gfp & GFP_KMEMLEAK_MASK);
640 if (!area) { 643 if (!area) {
641 kmemleak_warn("kmemleak: Cannot allocate a scan area\n"); 644 kmemleak_warn("kmemleak: Cannot allocate a scan area\n");
642 goto out; 645 goto out;