summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_misc.c
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-04-24 00:51:53 +0000
committerjhb <jhb@FreeBSD.org>2001-04-24 00:51:53 +0000
commit9c03a8ae91e06e47f0c59996ef0e2300e231e101 (patch)
treeec00c764b1eb58ed4297070edb5806ffd7ca4765 /sys/compat/linux/linux_misc.c
parent383dd0a2656889604bb7eb71b993875024ddd832 (diff)
downloadFreeBSD-src-9c03a8ae91e06e47f0c59996ef0e2300e231e101.zip
FreeBSD-src-9c03a8ae91e06e47f0c59996ef0e2300e231e101.tar.gz
Change the pfind() and zpfind() functions to lock the process that they
find before releasing the allproc lock and returning. Reviewed by: -smp, dfr, jake
Diffstat (limited to 'sys/compat/linux/linux_misc.c')
-rw-r--r--sys/compat/linux/linux_misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c
index ffb280c..fe422a9 100644
--- a/sys/compat/linux/linux_misc.c
+++ b/sys/compat/linux/linux_misc.c
@@ -558,10 +558,11 @@ linux_getpgid(struct proc *p, struct linux_getpgid_args *args)
if (args->pid != p->p_pid) {
if (!(curp = pfind(args->pid)))
return ESRCH;
+ p->p_retval[0] = curp->p_pgid;
+ PROC_UNLOCK(curp);
}
else
- curp = p;
- p->p_retval[0] = curp->p_pgid;
+ p->p_retval[0] = p->p_pgid;
return 0;
}
OpenPOWER on IntegriCloud