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
ad73989e21
commit
c1c2996ed2
@ -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