aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/ndis
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2015-07-11 16:22:48 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2015-07-11 16:22:48 +0000
commit8a08cec1660617204ccb44ee29cf3be4d1e63d33 (patch)
treef949fd85e6011817842d92d50f444ca5039ab9c7 /sys/compat/ndis
parentf0725a8e1e81a8f35311db80e00545f4bb6c2b9c (diff)
downloadsrc-8a08cec1660617204ccb44ee29cf3be4d1e63d33.tar.gz
src-8a08cec1660617204ccb44ee29cf3be4d1e63d33.zip
Create a dedicated function for ensuring that cdir and rdir are populated.
Previously several places were doing it on its own, partially incorrectly (e.g. without the filedesc locked) or even actively harmful by populating jdir or assigning rootvnode without vrefing it. Reviewed by: kib
Notes
Notes: svn path=/head/; revision=285391
Diffstat (limited to 'sys/compat/ndis')
-rw-r--r--sys/compat/ndis/subr_ndis.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/compat/ndis/subr_ndis.c b/sys/compat/ndis/subr_ndis.c
index f3ba70084119..ac26a2e093fc 100644
--- a/sys/compat/ndis/subr_ndis.c
+++ b/sys/compat/ndis/subr_ndis.c
@@ -2817,10 +2817,7 @@ NdisOpenFile(status, filehandle, filelength, filename, highestaddr)
/* Some threads don't have a current working directory. */
- if (td->td_proc->p_fd->fd_rdir == NULL)
- td->td_proc->p_fd->fd_rdir = rootvnode;
- if (td->td_proc->p_fd->fd_cdir == NULL)
- td->td_proc->p_fd->fd_cdir = rootvnode;
+ pwd_ensure_dirs();
NDINIT(&nd, LOOKUP, FOLLOW, UIO_SYSSPACE, path, td);