Module Name:    src
Committed By:   riastradh
Date:           Wed May 18 20:03:58 UTC 2022

Modified Files:
        src/sys/opencrypto: cryptodev.c

Log Message:
crypto(4): Simplify error test in cryptodev_op.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.111 -r1.112 src/sys/opencrypto/cryptodev.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/opencrypto/cryptodev.c
diff -u src/sys/opencrypto/cryptodev.c:1.111 src/sys/opencrypto/cryptodev.c:1.112
--- src/sys/opencrypto/cryptodev.c:1.111	Wed May 18 20:03:45 2022
+++ src/sys/opencrypto/cryptodev.c	Wed May 18 20:03:58 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: cryptodev.c,v 1.111 2022/05/18 20:03:45 riastradh Exp $ */
+/*	$NetBSD: cryptodev.c,v 1.112 2022/05/18 20:03:58 riastradh Exp $ */
 /*	$FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $	*/
 /*	$OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $	*/
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.111 2022/05/18 20:03:45 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.112 2022/05/18 20:03:58 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -647,22 +647,12 @@ cryptodev_op(struct csession *cse, struc
 			error = EINVAL;
 			goto bail;
 		}
-		crp->crp_mac=cse->tmp_mac;
+		crp->crp_mac = cse->tmp_mac;
 	}
 
 	cv_init(&crp->crp_cv, "crydev");
-
 	error = crypto_dispatch(crp);
-
-	/*
-	 * Don't touch crp before returned by any error or received
-	 * cv_signal(&crp->crp_cv). It is required to restructure locks.
-	 */
-
-	switch (error) {
-	case 0:
-		break;
-	default:
+	if (error) {
 		DPRINTF("not waiting, error.\n");
 		cv_destroy(&crp->crp_cv);
 		goto bail;

Reply via email to