Author: mmacy
Date: Sat May 19 04:07:00 2018
New Revision: 333840
URL: https://svnweb.freebsd.org/changeset/base/333840

Log:
  filt_timerdetach: only assign to old if we're going to check it in
  a KASSERT

Modified:
  head/sys/kern/kern_event.c

Modified: head/sys/kern/kern_event.c
==============================================================================
--- head/sys/kern/kern_event.c  Sat May 19 04:05:36 2018        (r333839)
+++ head/sys/kern/kern_event.c  Sat May 19 04:07:00 2018        (r333840)
@@ -751,12 +751,14 @@ static void
 filt_timerdetach(struct knote *kn)
 {
        struct kq_timer_cb_data *kc;
+#ifdef INVARIANTS
        unsigned int old;
+#endif
 
        kc = kn->kn_ptr.p_v;
        callout_drain(&kc->c);
        free(kc, M_KQUEUE);
-       old = atomic_fetchadd_int(&kq_ncallouts, -1);
+       DBGSET(old, atomic_fetchadd_int(&kq_ncallouts, -1));
        KASSERT(old > 0, ("Number of callouts cannot become negative"));
        kn->kn_status |= KN_DETACHED;   /* knlist_remove sets it */
 }
_______________________________________________
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