Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148989616
D23078.id66471.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
913 B
Referenced Files
None
Subscribers
None
D23078.id66471.diff
View Options
Index: sys/opencrypto/cryptodev.c
===================================================================
--- sys/opencrypto/cryptodev.c
+++ sys/opencrypto/cryptodev.c
@@ -1499,20 +1499,21 @@
switch (cmd) {
case CRIOGET:
+ error = falloc_noinstall(td, &f);
+ if (error)
+ break;
+
fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO);
TAILQ_INIT(&fcr->csessions);
mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF);
- error = falloc(td, &f, &fd, 0);
-
+ finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops);
+ error = finstall(td, f, &fd, 0, NULL);
if (error) {
mtx_destroy(&fcr->lock);
free(fcr, M_XDATA);
- return (error);
- }
- /* falloc automatically provides an extra reference to 'f'. */
- finit(f, FREAD | FWRITE, DTYPE_CRYPTO, fcr, &cryptofops);
- *(u_int32_t *)data = fd;
+ } else
+ *(uint32_t *)data = fd;
fdrop(f, td);
break;
case CRIOFINDDEV:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 22, 2:17 PM (16 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30124560
Default Alt Text
D23078.id66471.diff (913 B)
Attached To
Mode
D23078: Use falloc_noinstall + finstall.
Attached
Detach File
Event Timeline
Log In to Comment