1
Fork 0
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:
Andreas Kling 2021-09-06 12:03:13 +02:00
parent e3b063581e
commit f173f73f10
4 changed files with 5 additions and 20 deletions

View file

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