summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2015-09-15 15:59:48 -0500
committerLuiz Otavio O Souza <luiz@netgate.com>2015-10-20 12:04:47 -0500
commit3aa465ad9e65f5198257241a71eaa0a55929ba64 (patch)
treefc9522238c55ed31c435300ca332d55d8964448a /sys/opencrypto
parenteb4c2b213068efe8f5f927b6d6b5110a9855938b (diff)
downloadFreeBSD-src-3aa465ad9e65f5198257241a71eaa0a55929ba64.zip
FreeBSD-src-3aa465ad9e65f5198257241a71eaa0a55929ba64.tar.gz
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
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c2
1 files changed, 1 insertions, 1 deletions
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);
}
OpenPOWER on IntegriCloud