Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 232565
b: refs/heads/master
c: 6ae4bd1
h: refs/heads/master
i:
  232563: 103c6b8
v: v3
  • Loading branch information
Catalin Marinas committed Jan 27, 2011
1 parent 058bd4e commit 14ad46c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0a08739e81671de2cb690774937fe510c000b27f
refs/heads/master: 6ae4bd1f0bc479984f30061b5e5116060c24a267
13 changes: 8 additions & 5 deletions trunk/mm/kmemleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@
#define BYTES_PER_POINTER sizeof(void *)

/* GFP bitmask for kmemleak internal allocations */
#define GFP_KMEMLEAK_MASK (GFP_KERNEL | GFP_ATOMIC)
#define gfp_kmemleak_mask(gfp) (((gfp) & (GFP_KERNEL | GFP_ATOMIC)) | \
__GFP_NORETRY | __GFP_NOMEMALLOC | \
__GFP_NOWARN)

/* scanning area inside a memory block */
struct kmemleak_scan_area {
Expand Down Expand Up @@ -511,9 +513,10 @@ static struct kmemleak_object *create_object(unsigned long ptr, size_t size,
struct kmemleak_object *object;
struct prio_tree_node *node;

object = kmem_cache_alloc(object_cache, gfp & GFP_KMEMLEAK_MASK);
object = kmem_cache_alloc(object_cache, gfp_kmemleak_mask(gfp));
if (!object) {
kmemleak_stop("Cannot allocate a kmemleak_object structure\n");
pr_warning("Cannot allocate a kmemleak_object structure\n");
kmemleak_disable();
return NULL;
}

Expand Down Expand Up @@ -734,9 +737,9 @@ static void add_scan_area(unsigned long ptr, size_t size, gfp_t gfp)
return;
}

area = kmem_cache_alloc(scan_area_cache, gfp & GFP_KMEMLEAK_MASK);
area = kmem_cache_alloc(scan_area_cache, gfp_kmemleak_mask(gfp));
if (!area) {
kmemleak_warn("Cannot allocate a scan area\n");
pr_warning("Cannot allocate a scan area\n");
goto out;
}

Expand Down

0 comments on commit 14ad46c

Please sign in to comment.