瀏覽代碼

Kernel: When writing to device node, use can_write for checking

Instead of can_read which is wrong, use can_write.
Liav A 4 年之前
父節點
當前提交
a66c9fc593
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Kernel/FileSystem/DevFS.cpp

+ 1 - 1
Kernel/FileSystem/DevFS.cpp

@@ -387,7 +387,7 @@ ssize_t DevFSDeviceInode::write_bytes(off_t offset, ssize_t count, const UserOrK
 {
     LOCKER(m_lock);
     VERIFY(!!description);
-    if (!m_attached_device->can_read(*description, offset))
+    if (!m_attached_device->can_write(*description, offset))
         return -EIO;
     auto nread = const_cast<Device&>(*m_attached_device).write(*description, offset, buffer, count);
     if (nread.is_error())