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
Post a Comment