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:
Augustin Cavalier
2019-07-30 23:42:20 -04:00
parent 399fe9fc1a
commit 69a9cd36e6
+2 -1
View File
@@ -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;
}