mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +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:
parent
125be2923c
commit
a66c9fc593
Notes:
sideshowbarker
2024-07-18 21:21:05 +09:00
Author: https://github.com/supercomputer7
Commit: a66c9fc593
Pull-request: https://github.com/SerenityOS/serenity/pull/5796
1 changed files with 1 additions and 1 deletions
|
@ -387,7 +387,7 @@ ssize_t DevFSDeviceInode::write_bytes(off_t offset, ssize_t count, const UserOrK
|
||||||
{
|
{
|
||||||
LOCKER(m_lock);
|
LOCKER(m_lock);
|
||||||
VERIFY(!!description);
|
VERIFY(!!description);
|
||||||
if (!m_attached_device->can_read(*description, offset))
|
if (!m_attached_device->can_write(*description, offset))
|
||||||
return -EIO;
|
return -EIO;
|
||||||
auto nread = const_cast<Device&>(*m_attached_device).write(*description, offset, buffer, count);
|
auto nread = const_cast<Device&>(*m_attached_device).write(*description, offset, buffer, count);
|
||||||
if (nread.is_error())
|
if (nread.is_error())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue