diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2011-12-09 17:49:34 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2011-12-09 17:49:34 +0000 |
| commit | e517e6f12c7737187950438799a3806ce5642ff4 (patch) | |
| tree | 0b915424b33c81844740ad3e16df9bf3e1b074aa /sys/fs/devfs | |
| parent | cdea31e305c9a5bf471ee42a7a917d137bdaf041 (diff) | |
Notes
Diffstat (limited to 'sys/fs/devfs')
| -rw-r--r-- | sys/fs/devfs/devfs_vnops.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c index 22908b91aa8bd..408c98159dbf0 100644 --- a/sys/fs/devfs/devfs_vnops.c +++ b/sys/fs/devfs/devfs_vnops.c @@ -602,10 +602,14 @@ devfs_close_f(struct file *fp, struct thread *td) int error; struct file *fpop; - fpop = td->td_fpop; - td->td_fpop = fp; + /* + * NB: td may be NULL if this descriptor is closed due to + * garbage collection from a closed UNIX domain socket. + */ + fpop = curthread->td_fpop; + curthread->td_fpop = fp; error = vnops.fo_close(fp, td); - td->td_fpop = fpop; + curthread->td_fpop = fpop; /* * The f_cdevpriv cannot be assigned non-NULL value while we |
