summaryrefslogtreecommitdiffstats
path: root/contrib/sendmail/src/srvrsmtp.c
diff options
context:
space:
mode:
authorgibbs <gibbs@FreeBSD.org>2011-06-13 21:21:02 +0000
committergibbs <gibbs@FreeBSD.org>2011-06-13 21:21:02 +0000
commitf3f56007b6ff44fbfe31c8000573e05bc31a6234 (patch)
treea3425da958868cb6bcf024e812b8ec92b6758ef0 /contrib/sendmail/src/srvrsmtp.c
parent16addb86733d970dc3f900be1a0536276292efbe (diff)
downloadFreeBSD-src-f3f56007b6ff44fbfe31c8000573e05bc31a6234.zip
FreeBSD-src-f3f56007b6ff44fbfe31c8000573e05bc31a6234.tar.gz
Fix a couple of race conditions in devstat(9) initialization.
In devstat_new_entry(), there is no need to initialize the queue and the mutex in this function. There are ways to do static initialization on both, so use STAILQ_HEAD_INITIALIZER and MTX_SYSINIT to initialize the queue and the mutex. In devstat_alloc(), use an atomic test and set routine to guard making our entry in /dev. Using just a plain static variable creates a race condition on multiprocessor machines. If you attempt to create a second entry in devfs, the kernel will panic. Submitted by: kdm Reviewed by: gibbs Sponsored by: Spectra Logic Corporation MFC after: 1 week.
Diffstat (limited to 'contrib/sendmail/src/srvrsmtp.c')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud