Hi...

On Thu, Oct 28, 2010 at 00:10, Sankar P <[email protected]> wrote:
> Hi,
>
> I have an out of tree kernel module with the source:
>
> static __init int hello_init(void)
> {
>       char *ptr;
>       ptr = vmalloc(512);
>       ptr = vmalloc(512);
>       ptr = vmalloc(512);
>
>       printk(KERN_ALERT "Hello World");
>
>       return 0;
> }
>
> Now I compile this file (hello.c) using my Makefile as follows:
>
> EXTRA_CFLAGS=-g
> obj-m := hello-kernel.o
> hello-kernel-objs := hello.o
>
>
> Now if I insmod my hello-kernel.ko file and then do a `cat
> /sys/kernel/debug/kmemleak` I get an output:
>
> unreferenced object 0xf8211000 (size 512):
>  comm "insmod", pid 9602, jiffies 3666022 (age 1553.469s)

That's because the code path that causes the leak is running on behalf
of "insmod" process....

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to