From 6876d15b92c792d3dc529afbd4ff8e773e4c1df5 Mon Sep 17 00:00:00 2001 From: thib Date: Wed, 12 Jan 2011 23:18:56 +0000 Subject: 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@ --- sys/dev/diskmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev/diskmap.c') 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 @@ -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; -- cgit v1.2.3-59-g8ed1b