diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-05-07 08:53:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-05-07 08:53:34 +0000 |
commit | 1b64a290cb5c23b8ca6c35a93d7a1d417c0966b9 (patch) | |
tree | 11849275298a24e1f22849fd4aeda6e8e64e3c09 /sys/dev/diskmap.c | |
parent | 2e74448235b519e3016df1ec094e7aea1c4f46be (diff) |
Pass a thread pointer instead of its file descriptor table to getvnode(9).
Input and ok millert@
Diffstat (limited to 'sys/dev/diskmap.c')
-rw-r--r-- | sys/dev/diskmap.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/diskmap.c b/sys/dev/diskmap.c index 2b54b5c4c21..6086384da6b 100644 --- a/sys/dev/diskmap.c +++ b/sys/dev/diskmap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: diskmap.c,v 1.10 2015/03/14 03:38:46 jsg Exp $ */ +/* $OpenBSD: diskmap.c,v 1.11 2015/05/07 08:53:33 mpi Exp $ */ /* * Copyright (c) 2009, 2010 Joel Sing <jsing@openbsd.org> @@ -78,12 +78,12 @@ diskmapioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) goto invalid; /* Attempt to open actual device. */ + if ((error = getvnode(p, fd, &fp)) != 0) + goto invalid; + fdp = p->p_fd; fdplock(fdp); - if ((error = getvnode(fdp, fd, &fp)) != 0) - goto bad; - ndp.ni_segflg = UIO_SYSSPACE; ndp.ni_dirfd = AT_FDCWD; ndp.ni_dirp = devname; |