Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with...



details:   https://anonhg.NetBSD.org/src/rev/676fd14a8196
branches:  trunk
changeset: 771256:676fd14a8196
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 17 01:19:37 2011 +0000

description:
PR/45618: Motoyuki OHMORI: kqueue EVFILT_TIMER with smaller timeout value
makes DIAGNOSTIC kernel panic:
        KASSERT((c->c_flags & CALLOUT_PENDING) != 0);
If the computed ticks are <= 0 set it to 1

diffstat:

 sys/kern/kern_event.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 22ac54cb9ba7 -r 676fd14a8196 sys/kern/kern_event.c
--- a/sys/kern/kern_event.c     Thu Nov 17 01:14:12 2011 +0000
+++ b/sys/kern/kern_event.c     Thu Nov 17 01:19:37 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_event.c,v 1.72 2011/06/26 16:42:42 christos Exp $ */
+/*     $NetBSD: kern_event.c,v 1.73 2011/11/17 01:19:37 christos Exp $ */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.72 2011/06/26 16:42:42 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_event.c,v 1.73 2011/11/17 01:19:37 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -598,6 +598,8 @@
        knote_activate(kn);
        if ((kn->kn_flags & EV_ONESHOT) == 0) {
                tticks = mstohz(kn->kn_sdata);
+               if (tticks <= 0)
+                       tticks = 1;
                callout_schedule((callout_t *)kn->kn_hook, tticks);
        }
        mutex_exit(&kqueue_misc_lock);



Home | Main Index | Thread Index | Old Index