Module Name:    src
Committed By:   martin
Date:           Sun Feb 24 10:55:24 UTC 2019

Modified Files:
        src/sys/kern [netbsd-7-0]: kern_time.c

Log Message:
Pull up following revision(s) (requested by mlelstv in ticket #1196):

        sys/kern/kern_time.c: revision 1.196

The callout is used by any nonvirtual timer including CLOCK_MONOTONIC
and needs to be initialized.

Detected by [syzkaller].


To generate a diff of this commit:
cvs rdiff -u -r1.179.12.5 -r1.179.12.6 src/sys/kern/kern_time.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.179.12.5 src/sys/kern/kern_time.c:1.179.12.6
--- src/sys/kern/kern_time.c:1.179.12.5	Fri Feb  1 11:12:03 2019
+++ src/sys/kern/kern_time.c	Sun Feb 24 10:55:24 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.179.12.5 2019/02/01 11:12:03 martin Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.179.12.6 2019/02/24 10:55:24 martin Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.179.12.5 2019/02/01 11:12:03 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_time.c,v 1.179.12.6 2019/02/24 10:55:24 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/resourcevar.h>
@@ -1141,7 +1141,7 @@ dosetitimer(struct proc *p, int which, s
 		pt->pt_type = which;
 		pt->pt_entry = which;
 		pt->pt_queued = false;
-		if (pt->pt_type == CLOCK_REALTIME)
+		if (!CLOCK_VIRTUAL_P(which))
 			callout_init(&pt->pt_ch, CALLOUT_MPSAFE);
 		else
 			pt->pt_active = 0;

Reply via email to