Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern check the magic first in case we got passed a junk ...
details: https://anonhg.NetBSD.org/src/rev/7237e94fb779
branches: trunk
changeset: 828879:7237e94fb779
user: christos <christos%NetBSD.org@localhost>
date: Tue Jan 09 01:44:50 2018 +0000
description:
check the magic first in case we got passed a junk pointer.
diffstat:
sys/kern/kern_timeout.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (38 lines):
diff -r e4c1a1243ddb -r 7237e94fb779 sys/kern/kern_timeout.c
--- a/sys/kern/kern_timeout.c Mon Jan 08 23:34:56 2018 +0000
+++ b/sys/kern/kern_timeout.c Tue Jan 09 01:44:50 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kern_timeout.c,v 1.52 2017/06/01 02:45:13 chs Exp $ */
+/* $NetBSD: kern_timeout.c,v 1.53 2018/01/09 01:44:50 christos Exp $ */
/*-
* Copyright (c) 2003, 2006, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.52 2017/06/01 02:45:13 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_timeout.c,v 1.53 2018/01/09 01:44:50 christos Exp $");
/*
* Timeouts are kept in a hierarchical timing wheel. The c_time is the
@@ -304,6 +304,9 @@
{
callout_impl_t *c = (callout_impl_t *)cs;
+ KASSERTMSG(c->c_magic == CALLOUT_MAGIC,
+ "callout %p: c_magic (%#x) != CALLOUT_MAGIC (%#x)",
+ c, c->c_magic, CALLOUT_MAGIC);
/*
* It's not necessary to lock in order to see the correct value
* of c->c_flags. If the callout could potentially have been
@@ -313,9 +316,6 @@
"callout %p: c_func (%p) c_flags (%#x) destroyed from %p",
c, c->c_func, c->c_flags, __builtin_return_address(0));
KASSERT(c->c_cpu->cc_lwp == curlwp || c->c_cpu->cc_active != c);
- KASSERTMSG(c->c_magic == CALLOUT_MAGIC,
- "callout %p: c_magic (%#x) != CALLOUT_MAGIC (%#x)",
- c, c->c_magic, CALLOUT_MAGIC);
c->c_magic = 0;
}
Home |
Main Index |
Thread Index |
Old Index