From 3aa465ad9e65f5198257241a71eaa0a55929ba64 Mon Sep 17 00:00:00 2001 From: Luiz Otavio O Souza Date: Tue, 15 Sep 2015 15:59:48 -0500 Subject: MFC r284616: change the KASSERT so it is meaningful, var is unsigned, so even when it wraps, it's still >= 0... Reported by: Coverity CID: 1017564 TAG: IPSEC-HEAD Issue: #4841 --- sys/opencrypto/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/opencrypto/crypto.c') diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c index 0ecdeb3..d084b77 100644 --- a/sys/opencrypto/crypto.c +++ b/sys/opencrypto/crypto.c @@ -1181,8 +1181,8 @@ crypto_kdone(struct cryptkop *krp) /* XXX: What if driver is loaded in the meantime? */ if (krp->krp_hid < crypto_drivers_num) { cap = &crypto_drivers[krp->krp_hid]; + KASSERT(cap->cc_koperations > 0, ("cc_koperations == 0")); cap->cc_koperations--; - KASSERT(cap->cc_koperations >= 0, ("cc_koperations < 0")); if (cap->cc_flags & CRYPTOCAP_F_CLEANUP) crypto_remove(cap); } -- cgit v1.1