geting weird semi-random panic on kmalloc

NorthPole morfeas3000 at
Thu Jun 21 20:50:49 EDT 2012

Hello everyone

I'm making my first steps in the linux kernel developpement by trying to
add some functionality in a kernel module
I have a problem that I cant seem to grasp and would greatly appreciate any

I have this piece of code:
which is called by this:


This is supposed to add 250 distinct tlvs in the list
batadv_ogm_packet->gw_flags is used both above and bellow the invocation
and the module doesnt crash
the same stands for these two bat_priv and batadv_ogm_packet

when I run the kernel code on an open-wrt build for x86 which is run
virtualized under a standard qemu running on debian squeeze produces this
(in short it prints everything as its supposed to do for a random number of
iterations between 3 and 24 and the the kernel oops happens)

But i cant understand why the problem seems to happen at the kmalloc line
(havent figured how to use gdb for open wrt kernel debugging yet so i'm
relying on  printk for debugging)

the qemu instance loads with these setings

screen qemu\
-no-acpi -m 128M \
-net vde,sock=num1.ctl,port=1 -net nic,macaddr=fe:fe:00:00:01:01 \
-net nic -net tap,ifname=tapwrt1,script=no,downscript=no \
-nographic \

Thank you for your time and answers

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Kernelnewbies mailing list