diff --git a/kernel/src/sys/stat.cpp b/kernel/src/sys/stat.cpp index 3820dd08..ef8eb25f 100644 --- a/kernel/src/sys/stat.cpp +++ b/kernel/src/sys/stat.cpp @@ -40,7 +40,7 @@ Result sys_fstatat(Registers*, SyscallArgs args) kstat.st_uid = inode->uid(); kstat.st_gid = inode->gid(); kstat.st_size = inode->size(); - kstat.st_dev = inode->fs()->host_device_id(); + kstat.st_dev = inode->fs() ? inode->fs()->host_device_id() : 0; kstat.st_rdev = inode->device_id(); if (!MemoryManager::copy_to_user_typed(st, &kstat)) return err(EFAULT);