Date: Sun, 10 Dec 2006 22:58:19 GMT From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 111408 for review Message-ID: <200612102258.kBAMwJoo063105@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=111408 Change 111408 by sam@sam_ebb on 2006/12/10 22:57:32 guard against crypto_dispatch returning an error when re-submitted a symmetric op in the callback routine; previously we assumed it always worked Affected files ... .. //depot/projects/crypto/sys/opencrypto/cryptodev.c#8 edit Differences ... ==== //depot/projects/crypto/sys/opencrypto/cryptodev.c#8 (text+ko) ==== @@ -526,12 +526,16 @@ { struct cryptop *crp = (struct cryptop *) op; struct csession *cse = (struct csession *)crp->crp_opaque; + int error; - cse->error = crp->crp_etype; - if (crp->crp_etype == EAGAIN) - return crypto_dispatch(crp); + error = crp->crp_etype; + if (error == EAGAIN) + error = crypto_dispatch(crp); mtx_lock(&cse->lock); - wakeup_one(crp); + if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) { + cse->error = error; + wakeup_one(crp); + } mtx_unlock(&cse->lock); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612102258.kBAMwJoo063105>