mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
file: cleanfile null vnode protection
This commit is contained in:
@@ -33,8 +33,10 @@ static file_t* newfile() {
|
||||
}
|
||||
|
||||
static void cleanfile(file_t *file) {
|
||||
vfs_close(file->vnode, fileflagstovnodeflags(file->flags));
|
||||
VOP_RELEASE(file->vnode);
|
||||
if (file->vnode) {
|
||||
vfs_close(file->vnode, fileflagstovnodeflags(file->flags));
|
||||
VOP_RELEASE(file->vnode);
|
||||
}
|
||||
slab_free(filecache, file);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user