Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ad0f4090 authored by Zhang Rui's avatar Zhang Rui
Browse files

int340x_thermal/processor_thermal_device: return failure when



 there is no ACPI device object

processor_thermal_device driver needs ACPI support to work. Thus, the driver
probing should fail when there is no ACPI device object asscociated.

This fixes a NULL pointer dereference when the driver is loaded
with INT340X feature disabled in BIOS.

Reported-by: default avatarChen Yu <yu.c.chen@intel.com>
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Tested-by: default avatarChen Yu <yu.c.chen@intel.com>
parent 014d9d5d
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -130,6 +130,8 @@ static int proc_thermal_add(struct device *dev,
	int ret;
	int ret;


	adev = ACPI_COMPANION(dev);
	adev = ACPI_COMPANION(dev);
	if (!adev)
		return -ENODEV;


	status = acpi_evaluate_object(adev->handle, "PPCC", NULL, &buf);
	status = acpi_evaluate_object(adev->handle, "PPCC", NULL, &buf);
	if (ACPI_FAILURE(status))
	if (ACPI_FAILURE(status))