From 86b6bb04bb29835d037c6da592b44832ed26eb95 Mon Sep 17 00:00:00 2001 From: pjd Date: Tue, 6 Jun 2006 15:04:52 +0000 Subject: When DIAGNOSTIC is defined, verify if we don't free crypto requests from the crypto queue or from the return queue. --- sys/opencrypto/crypto.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'sys/opencrypto') 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); -- cgit v1.1