diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-05-18 20:03:58 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-05-18 20:03:58 +0000 |
| commit | 6715d2fb049cf96fa5a79d313c214c0e9699061c (patch) | |
| tree | e05372908f26645d4b6dcc8054c98bbee21ddbe9 /sys/opencrypto | |
| parent | 2bda5522b036e7678e0869f0808daf9b7b982f26 (diff) | |
crypto(4): Simplify error test in cryptodev_op.
No functional change intended.
Diffstat (limited to 'sys/opencrypto')
| -rw-r--r-- | sys/opencrypto/cryptodev.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c index f4398799f17..721c6d87c4e 100644 --- a/sys/opencrypto/cryptodev.c +++ b/sys/opencrypto/cryptodev.c @@ -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, struct crypt_op *cop, struct lwp *l) 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; |
