Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/opencrypto must release cap->cc_lock before calling cap-...



details:   https://anonhg.NetBSD.org/src/rev/7333faf8bc20
branches:  trunk
changeset: 824672:7333faf8bc20
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Wed Jun 14 07:32:19 2017 +0000

description:
must release cap->cc_lock before calling cap->cc_newsession() because of spinlock.

diffstat:

 sys/opencrypto/crypto.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 9db6379c92d7 -r 7333faf8bc20 sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c   Wed Jun 14 06:55:37 2017 +0000
+++ b/sys/opencrypto/crypto.c   Wed Jun 14 07:32:19 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypto.c,v 1.86 2017/06/08 00:17:02 christos Exp $ */
+/*     $NetBSD: crypto.c,v 1.87 2017/06/14 07:32:19 knakahara Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $   */
 /*     $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */
 
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.86 2017/06/08 00:17:02 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.87 2017/06/14 07:32:19 knakahara Exp $");
 
 #include <sys/param.h>
 #include <sys/reboot.h>
@@ -569,7 +569,9 @@
 
                        /* Call the driver initialization routine. */
                        lid = hid;              /* Pass the driver ID. */
+                       crypto_driver_unlock(cap);
                        err = cap->cc_newsession(cap->cc_arg, &lid, cri);
+                       crypto_driver_lock(cap);
                        if (err == 0) {
                                (*sid) = hid;
                                (*sid) <<= 32;



Home | Main Index | Thread Index | Old Index