aboutsummaryrefslogtreecommitdiff
path: root/sys/miscfs/procfs/procfs_fpregs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/miscfs/procfs/procfs_fpregs.c')
-rw-r--r--sys/miscfs/procfs/procfs_fpregs.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/sys/miscfs/procfs/procfs_fpregs.c b/sys/miscfs/procfs/procfs_fpregs.c
index 7074148cfbfc..c8afd55d96d9 100644
--- a/sys/miscfs/procfs/procfs_fpregs.c
+++ b/sys/miscfs/procfs/procfs_fpregs.c
@@ -56,30 +56,18 @@ procfs_dofpregs(curp, p, pfs, uio)
{
int error;
struct fpreg r;
- char *kv;
- int kl;
/* Can't trace a process that's currently exec'ing. */
if ((p->p_flag & P_INEXEC) != 0)
return EAGAIN;
if (!CHECKIO(curp, p) || p_trespass(curp, p))
return EPERM;
- kl = sizeof(r);
- kv = (char *) &r;
-
- kv += uio->uio_offset;
- kl -= uio->uio_offset;
- if (kl > uio->uio_resid)
- kl = uio->uio_resid;
PHOLD(p);
- if (kl < 0)
- error = EINVAL;
- else
- error = procfs_read_fpregs(p, &r);
+ error = procfs_read_fpregs(p, &r);
if (error == 0)
- error = uiomove(kv, kl, uio);
+ error = uiomove_frombuf(&r, sizeof(r), uio);
if (error == 0 && uio->uio_rw == UIO_WRITE) {
if (p->p_stat != SSTOP)
error = EBUSY;