When DIAGNOSTIC is defined, verify if we don't free crypto requests from

the crypto queue or from the return queue.
This commit is contained in:
Pawel Jakub Dawidek 2006-06-06 15:04:52 +00:00
parent e6c37eb632
commit 0d5c337bef
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=159346

View File

@ -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);