summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Joras <mjoras@FreeBSD.org>2017-10-16 16:14:50 +0000
committerMatt Joras <mjoras@FreeBSD.org>2017-10-16 16:14:50 +0000
commit0d8e04054ee6de957268ecbe4ff1b453263f32d1 (patch)
tree76cc0396c1e86c4561e0f14b4bc79442f39929fb
parentca1f624517bee47e896c04a01f97d2a4bf55b7a9 (diff)
Notes
-rw-r--r--sys/kern/subr_unit.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/subr_unit.c b/sys/kern/subr_unit.c
index c2110d72169f..867edbe75460 100644
--- a/sys/kern/subr_unit.c
+++ b/sys/kern/subr_unit.c
@@ -373,18 +373,17 @@ clear_unrhdr(struct unrhdr *uh)
KASSERT(TAILQ_EMPTY(&uh->ppfree),
("unrhdr has postponed item for free"));
- up = TAILQ_FIRST(&uh->head);
- while (up != NULL) {
- uq = TAILQ_NEXT(up, list);
+ TAILQ_FOREACH_SAFE(up, &uh->head, list, uq) {
if (up->ptr != uh) {
Free(up->ptr);
}
Free(up);
- up = uq;
}
- TAILQ_INIT(&uh->head);
uh->busy = 0;
uh->alloc = 0;
+ init_unrhdr(uh, uh->low, uh->high, uh->mtx);
+
+ check_unrhdr(uh, __LINE__);
}
static __inline int