Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162303915
D58049.id181324.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
858 B
Referenced Files
None
Subscribers
None
D58049.id181324.diff
View Options
diff --git a/sys/kern/kern_jaildesc.c b/sys/kern/kern_jaildesc.c
--- a/sys/kern/kern_jaildesc.c
+++ b/sys/kern/kern_jaildesc.c
@@ -153,18 +153,16 @@
if (error != 0)
return (error);
}
- jd = malloc(sizeof(*jd), M_JAILDESC, M_WAITOK | M_ZERO);
error = falloc_caps(td, &fp, fdp, 0, NULL);
- if (error != 0) {
- free(jd, M_JAILDESC);
+ if (error != 0)
return (error);
- }
- finit(fp, priv_check_cred(fp->f_cred, PRIV_JAIL_SET) == 0 ?
- FREAD | FWRITE : FREAD, DTYPE_JAILDESC, jd, &jaildesc_ops);
+ jd = malloc(sizeof(*jd), M_JAILDESC, M_WAITOK | M_ZERO);
JAILDESC_LOCK_INIT(jd);
knlist_init_mtx(&jd->jd_selinfo.si_note, &jd->jd_lock);
if (owning)
jd->jd_flags |= JDF_OWNING;
+ finit(fp, priv_check_cred(fp->f_cred, PRIV_JAIL_SET) == 0 ?
+ FREAD | FWRITE : FREAD, DTYPE_JAILDESC, jd, &jaildesc_ops);
*fpp = fp;
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 12, 9:12 PM (6 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34770071
Default Alt Text
D58049.id181324.diff (858 B)
Attached To
Mode
D58049: jaildesc: Publish the new fd only after the jaildesc is initialized
Attached
Detach File
Event Timeline
Log In to Comment