vfs: fix logic errors and leaks in vfs_open
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
parent
a8540494a9
commit
dd00e79b18
3 changed files with 69 additions and 22 deletions
11
lib/list.c
11
lib/list.c
|
|
@ -12,6 +12,17 @@ void list_create(list_t *list)
|
|||
list->tail = NULL;
|
||||
}
|
||||
|
||||
void list_destroy(list_t *list)
|
||||
{
|
||||
list_item_t *item = list->head;
|
||||
|
||||
while (item) {
|
||||
list_item_t *next = item->next;
|
||||
slab_free(list_cache, item);
|
||||
item = next;
|
||||
}
|
||||
}
|
||||
|
||||
list_item_t *list_insert(list_t *list, void *item)
|
||||
{
|
||||
spinlock_acquire(&list->lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue