Re: [PATCH 2.6.28-rc5 03/11] kmemleak: Add the memoryallocation/freeing hooks
From: Ingo Molnar
Date: Thu Nov 20 2008 - 07:01:20 EST
* Catalin Marinas <catalin.marinas@xxxxxxx> wrote:
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -112,6 +112,7 @@
> #include <linux/rtmutex.h>
> #include <linux/reciprocal_div.h>
> #include <linux/debugobjects.h>
> +#include <linux/memleak.h>
please move this line up 5-7 lines so that it auto-merges fine with
the kmemcheck-next tree.
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -24,6 +24,7 @@
> #include <linux/kallsyms.h>
> #include <linux/memory.h>
> #include <linux/math64.h>
> +#include <linux/memleak.h>
ditto.
> - return __vmalloc_area_node(area, gfp_mask, prot, -1,
> - __builtin_return_address(0));
> + void *addr = __vmalloc_area_node(area, gfp_mask, prot, -1,
> + __builtin_return_address(0));
> +
> + /* this needs ref_count = 2 since vm_struct also contains a
> + * pointer to this address. The guard page is also subtracted
> + * from the size */
> + memleak_alloc(addr, area->size - PAGE_SIZE, 2);
please use the customary comment style:
/*
* Comment .....
* ...... goes here:
*/
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/