Skip to content

Commit

Permalink
Kernel/Net: Propagate proper errno codes from determine_network_device
Browse files Browse the repository at this point in the history
Returning literal strings is not the proper action here, because we
should always assume that error could be propagated back to userland, so
we need to keep a valid errno when returning an Error.
  • Loading branch information
supercomputer7 authored and linusg committed Feb 10, 2023
1 parent 2715f91 commit 2d1719d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Kernel/Net/NetworkingManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ UNMAP_AFTER_INIT ErrorOr<NonnullLockRefPtr<NetworkAdapter>> NetworkingManagement
return adapter;
}
}
return Error::from_string_literal("Unsupported network adapter");
dmesgln("Networking: Failed to initialize device {}, unsupported network adapter", device_identifier.address());
return Error::from_errno(ENODEV);
}

bool NetworkingManagement::initialize()
Expand Down

0 comments on commit 2d1719d

Please sign in to comment.