Module Name: src
Committed By: christos
Date: Thu Jun 13 02:02:45 UTC 2019
Modified Files:
src/sys/opencrypto: cryptodev.c
Log Message:
don't always panic when modunload crypto (int the pool destroy code, because
the pools are busy). XXX: this is still racy; we need to prevent creating
more sessions while destroying.
To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 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.100 src/sys/opencrypto/cryptodev.c:1.101
--- src/sys/opencrypto/cryptodev.c:1.100 Fri Mar 1 06:06:57 2019
+++ src/sys/opencrypto/cryptodev.c Wed Jun 12 22:02:45 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: cryptodev.c,v 1.100 2019/03/01 11:06:57 pgoyette Exp $ */
+/* $NetBSD: cryptodev.c,v 1.101 2019/06/13 02:02:45 christos 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.100 2019/03/01 11:06:57 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.101 2019/06/13 02:02:45 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -2246,6 +2246,8 @@ crypto_modcmd(modcmd_t cmd, void *arg)
return error;
case MODULE_CMD_FINI:
#ifdef _MODULE
+ if (crypto_refcount != 0)
+ return EBUSY;
error = config_cfdata_detach(crypto_cfdata);
if (error) {
return error;