Add sanity check: Assert (gd_spinlocks_wr > 0) prior to decrementing it.
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 7 May 2009 20:45:34 +0000 (13:45 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 7 May 2009 20:45:34 +0000 (13:45 -0700)
Submitted-by: Antonio Huete Jimenez <ahuete.devel@gmail.com>
sys/sys/spinlock2.h

index b0fe767..0eb9249 100644 (file)
@@ -203,6 +203,7 @@ spin_unlock_wr_quick(globaldata_t gd, struct spinlock *mtx)
 #ifdef SMP
        mtx->lock = 0;
 #endif
+       KKASSERT(gd->gd_spinlocks_wr > 0);
        --gd->gd_spinlocks_wr;
 }