summaryrefslogtreecommitdiffstats
path: root/sys/opencrypto/cryptodev.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/opencrypto/cryptodev.c')
-rw-r--r--sys/opencrypto/cryptodev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/opencrypto/cryptodev.c b/sys/opencrypto/cryptodev.c
index 7de290c..15a207b 100644
--- a/sys/opencrypto/cryptodev.c
+++ b/sys/opencrypto/cryptodev.c
@@ -834,10 +834,12 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread
return (error);
}
/* falloc automatically provides an extra reference to 'f'. */
+ FILE_LOCK(f);
f->f_flag = FREAD | FWRITE;
f->f_type = DTYPE_CRYPTO;
- f->f_ops = &cryptofops;
f->f_data = fcr;
+ f->f_ops = &cryptofops;
+ FILE_UNLOCK(f);
*(u_int32_t *)data = fd;
fdrop(f, td);
break;
OpenPOWER on IntegriCloud