summaryrefslogtreecommitdiffstats
path: root/sys/fs/procfs/procfs_fpregs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/procfs/procfs_fpregs.c')
-rw-r--r--sys/fs/procfs/procfs_fpregs.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c
index 8501d9a..caabe49 100644
--- a/sys/fs/procfs/procfs_fpregs.c
+++ b/sys/fs/procfs/procfs_fpregs.c
@@ -62,8 +62,11 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
char *kv;
int kl;
- if (p_candebug(td->td_proc, p))
+ PROC_LOCK(p);
+ if (p_candebug(td->td_proc, p)) {
+ PROC_UNLOCK(p);
return (EPERM);
+ }
kl = sizeof(r);
kv = (char *) &r;
@@ -72,7 +75,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
if (kl > uio->uio_resid)
kl = uio->uio_resid;
- PHOLD(p);
+ _PHOLD(p);
if (kl < 0)
error = EINVAL;
else
@@ -87,7 +90,8 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
/* XXXKSE: */
error = proc_write_fpregs(FIRST_THREAD_IN_PROC(p), &r);
}
- PRELE(p);
+ _PRELE(p);
+ PROC_UNLOCK(p);
uio->uio_offset = 0;
return (error);
OpenPOWER on IntegriCloud