diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2023-06-21 16:36:12 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2023-06-23 12:28:01 -0500 |
commit | 5557b62634abbd55bab7b154ce4bca348ad7f96f (patch) | |
tree | 238b913ad2be04a824d3cf9ce19541d74c90f30f /lib/test-string_helpers.c | |
parent | 9e30fd26f43b89cb6b4e850a86caa2e50dedb454 (diff) |
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: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions