summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-03-14 22:03:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-03-15 09:06:41 +0100
commita66c9fc5932e3ea376cb5c681255aa1feba11f0b (patch)
treef021f0ce8f09c28c30464f741ab22e808938ef56
parent125be2923c26d7968809aada2b57a7313d1cd53b (diff)
downloadserenity-a66c9fc5932e3ea376cb5c681255aa1feba11f0b.zip
Kernel: When writing to device node, use can_write for checking
Instead of can_read which is wrong, use can_write.
-rw-r--r--Kernel/FileSystem/DevFS.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/FileSystem/DevFS.cpp b/Kernel/FileSystem/DevFS.cpp
index 67791f9183..b5be7f822d 100644
--- a/Kernel/FileSystem/DevFS.cpp
+++ b/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())