Double check the element is free in kore_pool_get().

This commit is contained in:
Joris Vink 2014-03-06 08:20:05 +01:00
parent 1375190936
commit 69f26823b9
1 changed files with 2 additions and 0 deletions

View File

@ -54,6 +54,8 @@ kore_pool_get(struct kore_pool *pool)
}
entry = LIST_FIRST(&(pool->freelist));
if (entry->state != POOL_ELEMENT_FREE)
fatal("%s: element %p was not free", pool->name, ptr);
LIST_REMOVE(entry, list);
entry->state = POOL_ELEMENT_BUSY;