Fix panic on NULL dereference possible after r212541.

This commit is contained in:
Alexander Motin 2010-09-14 10:26:49 +00:00
parent 0e18987383
commit 9aff0c8ff7

View File

@ -672,7 +672,8 @@ retry:
c->c_time = ticks + to_ticks;
TAILQ_INSERT_TAIL(&cc->cc_callwheel[c->c_time & callwheelmask],
c, c_links.tqe);
if ((c->c_time - cc->cc_firsttick) < 0) {
if ((c->c_time - cc->cc_firsttick) < 0 &&
callout_new_inserted != NULL) {
cc->cc_firsttick = c->c_time;
(*callout_new_inserted)(cpu,
to_ticks + (ticks - cc->cc_ticks));