Assert that si_threadcount > 0 before decrementing it. This helps catching
the improper use of the dev_refthread/dev_relthread. Tested by: pho MFC after: 1 week
This commit is contained in:
parent
772e245341
commit
06fe11294d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179248
@ -225,6 +225,8 @@ dev_relthread(struct cdev *dev)
|
||||
|
||||
mtx_assert(&devmtx, MA_NOTOWNED);
|
||||
dev_lock();
|
||||
KASSERT(dev->si_threadcount > 0,
|
||||
("%s threadcount is wrong", dev->si_name));
|
||||
dev->si_threadcount--;
|
||||
dev_unlock();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user