kernel - Fix incorrect assertion in lwkt_token_swap()
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 18 Nov 2011 20:03:09 +0000 (12:03 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 18 Nov 2011 20:03:09 +0000 (12:03 -0800)
* The bounds check for the two tokens was off by one, resulting in a crash
  under certain circumstances.

sys/kern/lwkt_token.c

index e44c3ec..30f3a42 100644 (file)
@@ -857,8 +857,8 @@ lwkt_token_swap(void)
 
        ref1 = td->td_toks_stop - 1;
        ref2 = td->td_toks_stop - 2;
-       KKASSERT(ref1 > &td->td_toks_base);
-       KKASSERT(ref2 > &td->td_toks_base);
+       KKASSERT(ref1 >= &td->td_toks_base);
+       KKASSERT(ref2 >= &td->td_toks_base);
 
        tok1 = ref1->tr_tok;
        tok2 = ref2->tr_tok;