Page MenuHomeFreeBSD

D23078.diff
No OneTemporary

D23078.diff

Index: head/sys/opencrypto/cryptodev.c
===================================================================
--- head/sys/opencrypto/cryptodev.c
+++ head/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

Mime Type
text/plain
Expires
Thu, Jan 23, 11:56 PM (20 h, 28 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16068181
Default Alt Text
D23078.diff (928 B)

Event Timeline