kernel/fs: Free file descriptors via put_fd(), not free().
FDs are now object_cached, so this triggered an assert-failure panic trying to put them through the regular allocator. Just use put_fd to free these instead, so that there is only one "destruction" path for FDs. Fixes #15213.
This commit is contained in:
@@ -2864,7 +2864,8 @@ get_new_fd(int type, struct fs_mount* mount, struct vnode* vnode,
|
||||
io_context* context = get_current_io_context(kernel);
|
||||
fd = new_fd(context, descriptor);
|
||||
if (fd < 0) {
|
||||
free(descriptor);
|
||||
descriptor->ops = NULL;
|
||||
put_fd(descriptor);
|
||||
return B_NO_MORE_FDS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user