linux - kernel timer function error -


i try modify tizen kernel. testing each line. so, find mod_timer kernel error what's problem???

code

  void timer_add(void){       struct timer_list timer;        setup_timer(&timer, kill_callback, 0);        mod_timer(&timer, jiffies + msecs_to_jiffies(3000));   }   void kill_callback(unsigned long data) {     sys_kill(current->pid, sigkill);     return ; } 

[ 19.029281] unable handle kernel null pointer dereference @ virtual addre

your function timer_add declares local variable timer, goes out of scope when function returns. pass argument function setup_timer, used set call function.

when call function executed @ later time, references variable timer, not exist more.

you either have declare variable timer static variable or use global variable.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -