summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThordur I. Bjornsson <thib@cvs.openbsd.org>2011-01-12 23:18:57 +0000
committerThordur I. Bjornsson <thib@cvs.openbsd.org>2011-01-12 23:18:57 +0000
commit3a8837c78a34da3ec56fab30a0105d16b052ecfa (patch)
tree099c80df1986121c5ff14df7b0048c24c3a0e062
parent270cc25add9881c526af062700a39fa7e157512b (diff)
Only init the nameidata parts that are strictly needed instead
of using NDINIT as vn_open overwrites and sets things up directly it self. the NDINIT usage here was actually wrong and would cause leaks if vn_open would totally honor the nameidata it gets passed, also there is one less place that triggers on my nameidata flag greps... ok jsing@
-rw-r--r--sys/dev/diskmap.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c
index f0abc974b9e..3a005e8550a 100644
--- a/sys/dev/diskmap.c
+++ b/sys/dev/diskmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskmap.c,v 1.2 2010/06/14 16:51:55 thib Exp $ */
+/* $OpenBSD: diskmap.c,v 1.3 2011/01/12 23:18:56 thib Exp $ */
/*
* Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org>
@@ -91,9 +91,9 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
goto bad;
}
- NDINIT(&ndp, LOOKUP, NOFOLLOW | LOCKLEAF | SAVENAME, UIO_SYSSPACE,
- devname, p);
-
+ ndp.ni_segflg = UIO_SYSSPACE;
+ ndp.ni_dirp = devname;
+ ndp.ni_cnd.cn_proc = p;
if ((error = vn_open(&ndp, fp->f_flag, 0)) != 0)
goto bad;