Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern Assert that l_target_cpu isn't nul...



details:   https://anonhg.NetBSD.org/src/rev/b7ea0e5a8864
branches:  trunk
changeset: 756313:b7ea0e5a8864
user:      pooka <pooka%NetBSD.org@localhost>
date:      Sun Jul 11 16:20:39 2010 +0000

description:
Assert that l_target_cpu isn't null, just in case we had some memory
corruption issues (like passing wrong size to kmem_free ....).

diffstat:

 sys/rump/librump/rumpkern/scheduler.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 9d6af969021f -r b7ea0e5a8864 sys/rump/librump/rumpkern/scheduler.c
--- a/sys/rump/librump/rumpkern/scheduler.c     Sun Jul 11 15:16:41 2010 +0000
+++ b/sys/rump/librump/rumpkern/scheduler.c     Sun Jul 11 16:20:39 2010 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: scheduler.c,v 1.16 2010/05/28 18:17:24 pooka Exp $    */
+/*      $NetBSD: scheduler.c,v 1.17 2010/07/11 16:20:39 pooka Exp $    */
 
 /*
  * Copyright (c) 2010 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.16 2010/05/28 18:17:24 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scheduler.c,v 1.17 2010/07/11 16:20:39 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -257,6 +257,7 @@
         * view of the world.
         */
 
+       KASSERT(l->l_target_cpu != NULL);
        rcpu = &rcpu_storage[l->l_target_cpu-&rump_cpus[0]];
        if (atomic_cas_ptr(&rcpu->rcpu_prevlwp, l, RCPULWP_BUSY) == l) {
                if (__predict_true(interlock == rcpu->rcpu_mtx))



Home | Main Index | Thread Index | Old Index