list: change locking discipline

Signed-off-by: Michael Shaw <m@michaelsshaw.com>
This commit is contained in:
Michael Shaw 2026-08-12 14:50:47 -04:00
commit 071a5651e0
Signed by: michaelsshaw
GPG key ID: 5A5E0FB20708A9E7
11 changed files with 61 additions and 15 deletions

View file

@ -313,8 +313,13 @@ void vfs_register(struct fs_driver *fs)
return;
memcpy(ins, fs, sizeof(*fs));
if (!list_insert(&fs_type_list, ins))
list_lock(&fs_type_list);
if (!list_insert(&fs_type_list, ins)) {
list_unlock(&fs_type_list);
kfree(ins);
} else {
list_unlock(&fs_type_list);
}
}
void vfs_init(void)