aboutsummaryrefslogtreecommitdiff
path: root/sys/security
diff options
context:
space:
mode:
authorDavide Italiano <davide@FreeBSD.org>2013-09-07 13:45:44 +0000
committerDavide Italiano <davide@FreeBSD.org>2013-09-07 13:45:44 +0000
commitd56b4cd4acc825cf2a4d1150bb93dc75e6513dc8 (patch)
tree6e614255289b5312f626893bca4618a0e9379c04 /sys/security
parent550ac4a8e884b3b45951fd4168cd4ebd6b4076d4 (diff)
downloadsrc-d56b4cd4acc825cf2a4d1150bb93dc75e6513dc8.tar.gz
src-d56b4cd4acc825cf2a4d1150bb93dc75e6513dc8.zip
- Use make_dev_credf(MAKEDEV_REF) instead of the race-prone make_dev()+
dev_ref() in the clone handlers that still use it. - Don't set SI_CHEAPCLONE flag, it's not used anywhere neither in devfs (for anything real) Reviewed by: kib
Notes
Notes: svn path=/head/; revision=255359
Diffstat (limited to 'sys/security')
-rw-r--r--sys/security/audit/audit_pipe.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/sys/security/audit/audit_pipe.c b/sys/security/audit/audit_pipe.c
index dc0df3e8ae4e..b2919753e076 100644
--- a/sys/security/audit/audit_pipe.c
+++ b/sys/security/audit/audit_pipe.c
@@ -672,14 +672,9 @@ audit_pipe_clone(void *arg, struct ucred *cred, char *name, int namelen,
return;
i = clone_create(&audit_pipe_clones, &audit_pipe_cdevsw, &u, dev, 0);
- if (i) {
- *dev = make_dev(&audit_pipe_cdevsw, u, UID_ROOT,
- GID_WHEEL, 0600, "%s%d", AUDIT_PIPE_NAME, u);
- if (*dev != NULL) {
- dev_ref(*dev);
- (*dev)->si_flags |= SI_CHEAPCLONE;
- }
- }
+ if (i)
+ *dev = make_dev_credf(MAKEDEV_REF, &audit_pipe_cdevsw, u, cred,
+ UID_ROOT, GID_WHEEL, 0600, "%s%d", AUDIT_PIPE_NAME, u);
}
/*