summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpi_processor.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-26 19:40:52 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-02-27 19:54:59 +0300
commit1b4f02a34f095b96de36fa16755f5598ba380939 (patch)
tree72733ca7c3c494c0a93f3b905c03174ed4665466 /drivers/acpi/acpi_processor.c
parent514bcabc05387369ee491b8359f34fcd45f25f55 (diff)
downloadlinux-1b4f02a34f095b96de36fa16755f5598ba380939.tar.xz
ACPI: scan: Make acpi_processor_add() check the device enabled bit
Modify acpi_processor_add() return an error if _STA returns the enabled bit clear for the given processor device, so as to avoid using processors that don't decode their resources, as per the ACPI specification. [1] Link: https://uefi.org/specs/ACPI/6.5/06_Device_Configuration.html#sta-device-status # [1] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/acpi/acpi_processor.c')
-rw-r--r--drivers/acpi/acpi_processor.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 4fe2ef54088c..99c28b7307c3 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -381,6 +381,9 @@ static int acpi_processor_add(struct acpi_device *device,
struct device *dev;
int result = 0;
+ if (!acpi_device_is_enabled(device))
+ return -ENODEV;
+
pr = kzalloc(sizeof(struct acpi_processor), GFP_KERNEL);
if (!pr)
return -ENOMEM;