diff --git a/kernel-src/sys/syscalls/statvfs.c b/kernel-src/sys/syscalls/statvfs.c index efd25c6a..3f9797fb 100644 --- a/kernel-src/sys/syscalls/statvfs.c +++ b/kernel-src/sys/syscalls/statvfs.c @@ -36,6 +36,11 @@ syscallret_t syscall_fstatvfs(context_t *ctx, int fd, statvfs_t *ustatvfs) { return ret; } + if (file->vnode->vfs == NULL) { + ret.errno = ENODEV; + goto cleanup; + } + fsattr_t buf; ret.errno = VFS_STATFS(file->vnode->vfs, &buf); if (ret.errno) @@ -98,6 +103,11 @@ syscallret_t syscall_fstatvfsat(context_t *ctx, int dirfd, char *upath, stat_t * // locked by vfs_lookup VOP_UNLOCK(node); + if (node->vfs == NULL) { + ret.errno = ENODEV; + goto cleanup; + } + fsattr_t buf; ret.errno = VFS_STATFS(node->vfs, &buf); if (ret.errno)