1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:25:07 +00:00

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

Instead of can_read which is wrong, use can_write.
This commit is contained in:
Liav A 2021-03-14 22:03:53 +02:00 committed by Andreas Kling
parent 125be2923c
commit a66c9fc593

View file

@ -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())