Module Name:    src
Committed By:   maxv
Date:           Sun Feb 12 18:43:56 UTC 2017

Modified Files:
        src/sys/kern: kern_clock.c

Log Message:
Add a KASSERT, otherwise it looks like a NULL deref; from Mootja.


To generate a diff of this commit:
cvs rdiff -u -r1.134 -r1.135 src/sys/kern/kern_clock.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_clock.c
diff -u src/sys/kern/kern_clock.c:1.134 src/sys/kern/kern_clock.c:1.135
--- src/sys/kern/kern_clock.c:1.134	Wed Apr 22 16:46:58 2015
+++ src/sys/kern/kern_clock.c	Sun Feb 12 18:43:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.134 2015/04/22 16:46:58 pooka Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.135 2017/02/12 18:43:56 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.134 2015/04/22 16:46:58 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_clock.c,v 1.135 2017/02/12 18:43:56 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dtrace.h"
@@ -394,6 +394,7 @@ statclock(struct clockframe *frame)
 	}
 
 	if (CLKF_USERMODE(frame)) {
+		KASSERT(p != NULL);
 		if ((p->p_stflag & PST_PROFIL) && profsrc == PROFSRC_CLOCK)
 			addupc_intr(l, CLKF_PC(frame));
 		if (--spc->spc_pscnt > 0) {

Reply via email to