summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)