From b49f2937f06fa4699e996cf852dfb98428199a83 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 8 Jul 2023 14:45:57 +0300 Subject: [PATCH] Kernel/TTY: Don't return NonnullLockRefPtr when creating MasterPTY We can just return a normal NonnullRefPtr because nobody needs an actual *LockRefPtrs here anymore. --- Kernel/Devices/TTY/MasterPTY.cpp | 6 +++--- Kernel/Devices/TTY/MasterPTY.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/Devices/TTY/MasterPTY.cpp b/Kernel/Devices/TTY/MasterPTY.cpp index 8a934e4c12a..7c262b6c7dc 100644 --- a/Kernel/Devices/TTY/MasterPTY.cpp +++ b/Kernel/Devices/TTY/MasterPTY.cpp @@ -16,12 +16,12 @@ namespace Kernel { -ErrorOr> MasterPTY::try_create(unsigned int index) +ErrorOr> MasterPTY::try_create(unsigned int index) { auto buffer = TRY(DoubleBuffer::try_create("MasterPTY: Buffer"sv)); - auto master_pty = TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) MasterPTY(index, move(buffer)))); + auto master_pty = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) MasterPTY(index, move(buffer)))); auto credentials = Process::current().credentials(); - auto slave_pty = TRY(adopt_nonnull_lock_ref_or_enomem(new (nothrow) SlavePTY(*master_pty, credentials->uid(), credentials->gid(), index))); + auto slave_pty = TRY(adopt_nonnull_ref_or_enomem(new (nothrow) SlavePTY(*master_pty, credentials->uid(), credentials->gid(), index))); master_pty->m_slave.with([&slave_pty](auto& slave) { slave = *slave_pty; }); diff --git a/Kernel/Devices/TTY/MasterPTY.h b/Kernel/Devices/TTY/MasterPTY.h index 4334056f67a..9d10d49c70d 100644 --- a/Kernel/Devices/TTY/MasterPTY.h +++ b/Kernel/Devices/TTY/MasterPTY.h @@ -16,7 +16,7 @@ class SlavePTY; class MasterPTY final : public CharacterDevice { public: - static ErrorOr> try_create(unsigned index); + static ErrorOr> try_create(unsigned index); virtual ~MasterPTY() override; unsigned index() const { return m_index; }