Fix the same bug as in procfs_doproc{,db}regs(): check that uio_offset is

0 upon entry, and don't reset it before returning.

MFC after:	3 weeks
This commit is contained in:
Dag-Erling Smørgrav 2007-04-15 13:29:36 +00:00
parent 66cd74a611
commit 302762c344
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=168759

View File

@ -89,6 +89,9 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
int wrap32 = 0;
#endif
if (uio->uio_offset != 0)
return (0);
PROC_LOCK(p);
KASSERT(p->p_lock > 0, ("proc not held"));
if (p_candebug(td, p)) {
@ -122,6 +125,5 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
}
PROC_UNLOCK(p);
uio->uio_offset = 0;
return (error);
}