summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-06-06 15:04:52 +0000
committerpjd <pjd@FreeBSD.org>2006-06-06 15:04:52 +0000
commit86b6bb04bb29835d037c6da592b44832ed26eb95 (patch)
treeb45f354eea69869019ec349b4841357dd477ed8d /sys/opencrypto
parent0b53b5c4a9ca7442ae3b5f23a6c9f1d773b43f30 (diff)
downloadFreeBSD-src-86b6bb04bb29835d037c6da592b44832ed26eb95.zip
FreeBSD-src-86b6bb04bb29835d037c6da592b44832ed26eb95.tar.gz
When DIAGNOSTIC is defined, verify if we don't free crypto requests from
the crypto queue or from the return queue.
Diffstat (limited to 'sys/opencrypto')
-rw-r--r--sys/opencrypto/crypto.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/sys/opencrypto/crypto.c b/sys/opencrypto/crypto.c
index fbf039f..e75af74 100644
--- a/sys/opencrypto/crypto.c
+++ b/sys/opencrypto/crypto.c
@@ -903,6 +903,27 @@ crypto_freereq(struct cryptop *crp)
if (crp == NULL)
return;
+#ifdef DIAGNOSTIC
+ {
+ struct cryptop *crp2;
+
+ CRYPTO_Q_LOCK();
+ TAILQ_FOREACH(crp2, &crp_q, crp_next) {
+ KASSERT(crp2 != crp,
+ ("Freeing cryptop from the crypto queue (%p).",
+ crp));
+ }
+ CRYPTO_Q_UNLOCK();
+ CRYPTO_RETQ_LOCK();
+ TAILQ_FOREACH(crp2, &crp_ret_q, crp_next) {
+ KASSERT(crp2 != crp,
+ ("Freeing cryptop from the return queue (%p).",
+ crp));
+ }
+ CRYPTO_RETQ_UNLOCK();
+ }
+#endif
+
while ((crd = crp->crp_desc) != NULL) {
crp->crp_desc = crd->crd_next;
uma_zfree(cryptodesc_zone, crd);
OpenPOWER on IntegriCloud