PERFORCE change 111408 for review

Sam Leffler sam at FreeBSD.org
Sun Dec 10 14:58:20 PST 2006


http://perforce.freebsd.org/chv.cgi?CH=111408

Change 111408 by sam at 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);
 }


More information about the p4-projects mailing list