Author: kib
Date: Mon Dec 26 19:28:10 2016
New Revision: 310615
URL: https://svnweb.freebsd.org/changeset/base/310615

Log:
  Change knlist_destroy() to assert that knlist is empty instead of
  accepting the wrong state and printing warning.  Do not obliterate
  kl_lock and kl_unlock pointers, they are often useful for post-mortem
  analysis.
  
  Reviewed by:  markj
  Tested by:    pho
  Sponsored by: The FreeBSD Foundation
  MFC after:    2 weeks
  X-Differential revision:      https://reviews.freebsd.org/D8898

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c  Mon Dec 26 19:27:12 2016        (r310614)
+++ head/sys/kern/kern_event.c  Mon Dec 26 19:28:10 2016        (r310615)
@@ -2249,17 +2249,8 @@ void
 knlist_destroy(struct knlist *knl)
 {
 
-#ifdef INVARIANTS
-       /*
-        * if we run across this error, we need to find the offending
-        * driver and have it call knlist_clear or knlist_delete.
-        */
-       if (!SLIST_EMPTY(&knl->kl_list))
-               printf("WARNING: destroying knlist w/ knotes on it!\n");
-#endif
-
-       knl->kl_lockarg = knl->kl_lock = knl->kl_unlock = NULL;
-       SLIST_INIT(&knl->kl_list);
+       KASSERT(KNLIST_EMPTY(knl),
+           ("destroying knlist %p with knotes on it", knl));
 }
 
 void
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to