mirror of
https://github.com/RGBCube/serenity
synced 2025-05-15 09:54:57 +00:00
Kernel/USB: Use TRY() and adopt_nonnull_own_or_enomem() some more
This commit is contained in:
parent
e3b063581e
commit
f173f73f10
4 changed files with 5 additions and 20 deletions
|
@ -52,9 +52,7 @@ KResult SysFSUSBDeviceInformation::refresh_data(FileDescription& description) co
|
|||
MutexLocker lock(m_lock);
|
||||
auto& cached_data = description.data();
|
||||
if (!cached_data) {
|
||||
cached_data = adopt_own_if_nonnull(new (nothrow) SysFSInodeData);
|
||||
if (!cached_data)
|
||||
return ENOMEM;
|
||||
cached_data = TRY(adopt_nonnull_own_or_enomem(new (nothrow) SysFSInodeData));
|
||||
}
|
||||
KBufferBuilder builder;
|
||||
if (!const_cast<SysFSUSBDeviceInformation&>(*this).output(builder))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue