summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-02-07 22:22:03 +0100
committerAnton Kling <anton@kling.gg>2024-02-07 22:25:47 +0100
commitadd659ce894352e967905ddf74683f28d2c2e44e (patch)
treee19a5cfea27f5b177afd2f06960c3bb3c3957959 /kernel
parent08c446612959fb190c7d6f604c69031007c3bc23 (diff)
Kernel: poll() should skip invalid file descriptors
Diffstat (limited to 'kernel')
-rw-r--r--kernel/poll.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/poll.c b/kernel/poll.c
index ee92a8c..5181417 100644
--- a/kernel/poll.c
+++ b/kernel/poll.c
@@ -13,6 +13,9 @@ int poll(struct pollfd *fds, size_t nfds, int timeout) {
if (fds[i].fd < 0)
continue;
vfs_fd_t *f = get_vfs_fd(fds[i].fd);
+ if (NULL == f) {
+ continue;
+ }
if (fds[i].events & POLLIN)
read_locks[i] = create_read_fdhalt(f);
if (fds[i].events & POLLOUT)