mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-11-24 20:48:55 +00:00
acpi: improve check against acpi_mc_group id and improve error msgs
Make sure that the group id received from get_acpi_event_group is not 0 before proceeding it further. At the occasion improve some error messages. As per review comments: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3407321/27 that I didn't make before it was merged. BUG=None TEST=Build and boot volteer-manatee Change-Id: I41a77fc3de10b13905f3f94277d2284acf29e67f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/3539980 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org> Tested-by: kokoro <noreply+kokoro@google.com> Commit-Queue: Grzegorz Jaszczyk <jaszczyk@google.com>
This commit is contained in:
parent
2fc3036ba8
commit
9317c41ed7
1 changed files with 4 additions and 4 deletions
|
@ -23,9 +23,9 @@ pub enum ACPIPMError {
|
|||
/// Error while waiting for events.
|
||||
#[error("failed to wait for events: {0}")]
|
||||
WaitError(SysError),
|
||||
#[error("Did not found group_id corresponding to acpi_mc_group")]
|
||||
#[error("Did not find group_id corresponding to acpi_mc_group")]
|
||||
AcpiMcGroupError,
|
||||
#[error("Failed to create and bind NETLINK_GENERIC socket, listening on acpi_mc_group: {0}")]
|
||||
#[error("Failed to create and bind NETLINK_GENERIC socket for acpi_mc_group: {0}")]
|
||||
AcpiEventSockError(base::Error),
|
||||
}
|
||||
|
||||
|
@ -174,11 +174,11 @@ fn run_worker(
|
|||
// Get group id corresponding to acpi_mc_group of acpi_event family
|
||||
let nl_groups: u32;
|
||||
match get_acpi_event_group() {
|
||||
Some(group) => {
|
||||
Some(group) if group > 0 => {
|
||||
nl_groups = 1 << (group - 1);
|
||||
info!("Listening on acpi_mc_group of acpi_event family");
|
||||
}
|
||||
None => {
|
||||
_ => {
|
||||
return Err(ACPIPMError::AcpiMcGroupError);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue