kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* add_timer crashes the kernel,Why?
@ 2010-12-20  8:27 lijin liu
  2010-12-20  8:43 ` Raz
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: lijin liu @ 2010-12-20  8:27 UTC (permalink / raw)
  To: kernelnewbies

Hello everyone!

I want to use the timer in my kernel module. I read the book  _Linux
kernel development 3rd version_  and LDD 3rd version.

Both the two books tell me write the code like this:

struct timer_list my_timer;
init_timer(&my_timer);

my_timer.expires = jiffies + wait;
my_timer.data = 0;
my_timer.function=my_function;

//active the timer:
add_timer(&timer);


When I insmod the module, the kernel crashed, and when I change my
code to *mod_timer* rather than add_timer.

It just works!

But why the add_timer crash the kernel?

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-12-20 14:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-20  8:27 add_timer crashes the kernel,Why? lijin liu
2010-12-20  8:43 ` Raz
2010-12-20  9:06 ` Wick
     [not found] ` <AANLkTikY4+BqhjrNYiwR+1WrN53+_6JGiCkJ-kCTGL-B@mail.gmail.com>
2010-12-20  9:06   ` lijin liu
2010-12-20  9:33     ` Mulyadi Santosa
2010-12-20  9:08 ` Mulyadi Santosa
2010-12-20 14:15   ` Dexter Haslem

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).