Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 147735
b: refs/heads/master
c: 4374e61
h: refs/heads/master
i:
  147733: 514ba7a
  147731: 067871e
  147727: 6acb80f
v: v3
  • Loading branch information
Catalin Marinas committed Jun 11, 2009
1 parent 059f234 commit 97901bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5cff635290aec9ad7e6ee546aa4fae895361cbb
refs/heads/master: 4374e616d28e65265a5b433ceece275449f3d2e3
7 changes: 7 additions & 0 deletions trunk/mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#include <linux/rcupdate.h>
#include <linux/list.h>
#include <linux/kmemtrace.h>
#include <linux/kmemleak.h>
#include <asm/atomic.h>

/*
Expand Down Expand Up @@ -509,6 +510,7 @@ void *__kmalloc_node(size_t size, gfp_t gfp, int node)
size, PAGE_SIZE << order, gfp, node);
}

kmemleak_alloc(ret, size, 1, gfp);
return ret;
}
EXPORT_SYMBOL(__kmalloc_node);
Expand All @@ -521,6 +523,7 @@ void kfree(const void *block)

if (unlikely(ZERO_OR_NULL_PTR(block)))
return;
kmemleak_free(block);

sp = slob_page(block);
if (is_slob_page(sp)) {
Expand Down Expand Up @@ -584,12 +587,14 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
} else if (flags & SLAB_PANIC)
panic("Cannot create slab cache %s\n", name);

kmemleak_alloc(c, sizeof(struct kmem_cache), 1, GFP_KERNEL);
return c;
}
EXPORT_SYMBOL(kmem_cache_create);

void kmem_cache_destroy(struct kmem_cache *c)
{
kmemleak_free(c);
slob_free(c, sizeof(struct kmem_cache));
}
EXPORT_SYMBOL(kmem_cache_destroy);
Expand All @@ -613,6 +618,7 @@ void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
if (c->ctor)
c->ctor(b);

kmemleak_alloc_recursive(b, c->size, 1, c->flags, flags);
return b;
}
EXPORT_SYMBOL(kmem_cache_alloc_node);
Expand All @@ -635,6 +641,7 @@ static void kmem_rcu_free(struct rcu_head *head)

void kmem_cache_free(struct kmem_cache *c, void *b)
{
kmemleak_free_recursive(b, c->flags);
if (unlikely(c->flags & SLAB_DESTROY_BY_RCU)) {
struct slob_rcu *slob_rcu;
slob_rcu = b + (c->size - sizeof(struct slob_rcu));
Expand Down

0 comments on commit 97901bf

Please sign in to comment.