Module Name: src Committed By: rmind Date: Tue Nov 24 20:11:51 UTC 2009
Modified Files: src/sys/kern: subr_callback.c Log Message: Add assert that ce->ce_func is not NULL. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/kern/subr_callback.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/subr_callback.c diff -u src/sys/kern/subr_callback.c:1.6 src/sys/kern/subr_callback.c:1.7 --- src/sys/kern/subr_callback.c:1.6 Wed Dec 5 07:06:54 2007 +++ src/sys/kern/subr_callback.c Tue Nov 24 20:11:50 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_callback.c,v 1.6 2007/12/05 07:06:54 ad Exp $ */ +/* $NetBSD: subr_callback.c,v 1.7 2009/11/24 20:11:50 rmind Exp $ */ /*- * Copyright (c)2006 YAMAMOTO Takashi, @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: subr_callback.c,v 1.6 2007/12/05 07:06:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_callback.c,v 1.7 2009/11/24 20:11:50 rmind Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -63,6 +63,7 @@ void *obj, int (*fn)(struct callback_entry *, void *, void *)) { + KASSERT(fn != NULL); ce->ce_func = fn; ce->ce_obj = obj; mutex_enter(&ch->ch_lock); @@ -100,6 +101,7 @@ ce = TAILQ_FIRST(&ch->ch_q); } KASSERT(ce != NULL); + KASSERT(ce->ce_func != NULL); result = (*ce->ce_func)(ce, ce->ce_obj, arg); ch->ch_next = TAILQ_NEXT(ce, ce_q); return result;