Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 5557b626 authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

PCI/ACPI: Validate acpi_pci_set_power_state() parameter

Previously acpi_pci_set_power_state() assumed the requested power state was
valid (PCI_D0 ... PCI_D3cold).  If a caller supplied something else, we
could index outside the state_conv[] array and pass junk to
acpi_device_set_power().

Validate the pci_power_t parameter and return -EINVAL if it's invalid.

Link: https://lore.kernel.org/r/20230621222857.GA122930@bhelgaas


Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
parent 9e30fd26
Branches
Tags
No related merge requests found
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment