diff options
author | jhb <jhb@FreeBSD.org> | 2001-03-07 02:07:56 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-03-07 02:07:56 +0000 |
commit | 6958204c78a2f8d8aeda75daa86f9a6502384a16 (patch) | |
tree | 52694f4fad9bdb6c487bfeb872e2c56458a0e0d8 /sys/fs/procfs/procfs_dbregs.c | |
parent | 9629364e629777a1ac591d053bbdb16b2097ede3 (diff) | |
download | FreeBSD-src-6958204c78a2f8d8aeda75daa86f9a6502384a16.zip FreeBSD-src-6958204c78a2f8d8aeda75daa86f9a6502384a16.tar.gz |
Protect p_flag with the proc lock.
Diffstat (limited to 'sys/fs/procfs/procfs_dbregs.c')
-rw-r--r-- | sys/fs/procfs/procfs_dbregs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c index c7ad130..6d35da0 100644 --- a/sys/fs/procfs/procfs_dbregs.c +++ b/sys/fs/procfs/procfs_dbregs.c @@ -96,5 +96,10 @@ int procfs_validdbregs(p) struct proc *p; { - return ((p->p_flag & P_SYSTEM) == 0); + int valid; + + PROC_LOCK(p); + valid = (p->p_flag & P_SYSTEM) == 0; + PROC_UNLOCK(p); + return (valid); } |