mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-31 23:42:52 +00:00
Kernel/USB: Use TRY() and adopt_nonnull_own_or_enomem() some more
This commit is contained in:
parent
e3b063581e
commit
f173f73f10
Notes:
sideshowbarker
2024-07-18 04:37:19 +09:00
Author: https://github.com/awesomekling
Commit: f173f73f10
4 changed files with 5 additions and 20 deletions
|
@ -85,11 +85,7 @@ static USBHubDescriptor uhci_root_hub_hub_descriptor = {
|
|||
|
||||
KResultOr<NonnullOwnPtr<UHCIRootHub>> UHCIRootHub::try_create(NonnullRefPtr<UHCIController> uhci_controller)
|
||||
{
|
||||
auto root_hub = adopt_own_if_nonnull(new (nothrow) UHCIRootHub(uhci_controller));
|
||||
if (!root_hub)
|
||||
return ENOMEM;
|
||||
|
||||
return root_hub.release_nonnull();
|
||||
return adopt_nonnull_own_or_enomem(new (nothrow) UHCIRootHub(uhci_controller));
|
||||
}
|
||||
|
||||
UHCIRootHub::UHCIRootHub(NonnullRefPtr<UHCIController> uhci_controller)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue