aboutsummaryrefslogtreecommitdiff
path: root/sys/opencrypto/cryptodev.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2004-07-22 18:35:43 +0000
committerRobert Watson <rwatson@FreeBSD.org>2004-07-22 18:35:43 +0000
commit1c1ce9253fb52a3befc1c6179e57c8ce2dfd5187 (patch)
treef7e2beb855def63afc1059aa39f7053e07c81046 /sys/opencrypto/cryptodev.c
parentdf04411ac4c9744d1dbc38bd50c27d8ee5c261cd (diff)
Notes
Diffstat (limited to 'sys/opencrypto/cryptodev.c')
-rw-r--r--sys/opencrypto/cryptodev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index 9b0da7ce30264..26b24477be775 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -623,12 +623,19 @@ cryptof_close(struct file *fp, struct thread *td)
struct fcrypt *fcr = fp->f_data;
struct csession *cse;
+ /*
+ * XXXRW: The cryptodev and called code all appears to be
+ * MPSAFE, but I'm not set up to test it. Acquire Giant
+ * for now.
+ */
+ mtx_lock(&Giant);
while ((cse = TAILQ_FIRST(&fcr->csessions))) {
TAILQ_REMOVE(&fcr->csessions, cse, next);
(void)csefree(cse);
}
FREE(fcr, M_XDATA);
fp->f_data = NULL;
+ mtx_unlock(&Giant);
return 0;
}