]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/slub.c
infrastructure to debug (dynamic) objects
[mirror_ubuntu-artful-kernel.git] / mm / slub.c
index b145e798bf3d477054b0445719522be94ca7e9f8..70db2897c1ea626ea3b6f576fda91fa6c3c48cd9 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -19,6 +19,7 @@
 #include <linux/cpuset.h>
 #include <linux/mempolicy.h>
 #include <linux/ctype.h>
+#include <linux/debugobjects.h>
 #include <linux/kallsyms.h>
 #include <linux/memory.h>
 
@@ -1747,6 +1748,8 @@ static __always_inline void slab_free(struct kmem_cache *s,
        local_irq_save(flags);
        c = get_cpu_slab(s, smp_processor_id());
        debug_check_no_locks_freed(object, c->objsize);
+       if (!(s->flags & SLAB_DEBUG_OBJECTS))
+               debug_check_no_obj_freed(object, s->objsize);
        if (likely(page == c->page && c->node >= 0)) {
                object[c->offset] = c->freelist;
                c->freelist = object;