<div>Hello everyone<br></div><div><br></div><div>I&#39;m making my first steps in the linux kernel developpement by trying to add some functionality in a kernel module</div><div>I have a problem that I cant seem to grasp and would greatly appreciate any help.</div>

<div><br></div><div>I have this piece of code: <a href="http://pastebin.com/igP7255S">http://pastebin.com/igP7255S</a> </div><div>which is called by this:</div><div><br></div><div>for(i=0;i&lt;250;i++)</div><div>registerTvlv(i,0x01,1,&amp;batadv_ogm_packet-&gt;gw_flags,bat_priv,batadv_ogm_packet);<br>

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

<div><br></div><div>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 output</div><div><a href="http://pastebin.com/tY3Vkzvw">http://pastebin.com/tY3Vkzvw</a>  </div>

<div>(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)</div><div><br></div><div>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&#39;m relying on  printk for debugging)</div>

<div><br></div><div><br></div><div>the qemu instance loads with these setings</div><div><br></div><div>screen qemu\<br>        -no-acpi -m 128M \<br>        -net vde,sock=num1.ctl,port=1 -net nic,macaddr=fe:fe:00:00:01:01 \<br>

        -net nic -net tap,ifname=tapwrt1,script=no,downscript=no \<br>        -nographic \<br>        num1.image<br></div><div><br></div><div>Thank you for your time and answers</div><div><br></div><div>Spyros</div>