Linux ACPI
 help / color / mirror / Atom feed
* [PATCH] Do copy passive devices only if they are valid
@ 2008-03-06 22:33 Thomas Renninger
  2008-03-07  1:07 ` Zhang, Rui
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Renninger @ 2008-03-06 22:33 UTC (permalink / raw)
  To: ming.m.lin; +Cc: Zhang, Rui, linux-acpi

Warn user about a BIOS bug in recent asus boards

Do copy passive devices only if they are valid.

Signed-off-by: Thomas Renninger <trenn@suse.de>

---
 drivers/acpi/thermal.c |   20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

Index: linux-2.6.24/drivers/acpi/thermal.c
===================================================================
--- linux-2.6.24.orig/drivers/acpi/thermal.c
+++ linux-2.6.24/drivers/acpi/thermal.c
@@ -440,16 +440,18 @@ static int acpi_thermal_trips_update(str
 		memset(&devices, 0, sizeof(struct acpi_handle_list));
 		status = acpi_evaluate_reference(tz->device->handle, "_PSL",
 							NULL, &devices);
-		if (ACPI_FAILURE(status))
-			tz->trips.passive.flags.valid = 0;
-		else
+		if (ACPI_SUCCESS(status)) {
 			tz->trips.passive.flags.valid = 1;
-
-		if (memcmp(&tz->trips.passive.devices, &devices,
-				sizeof(struct acpi_handle_list))) {
-			memcpy(&tz->trips.passive.devices, &devices,
-				sizeof(struct acpi_handle_list));
-			ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
+			if (memcmp(&tz->trips.passive.devices, &devices,
+				   sizeof(struct acpi_handle_list))) {
+				memcpy(&tz->trips.passive.devices, &devices,
+				       sizeof(struct acpi_handle_list));
+				ACPI_THERMAL_TRIPS_EXCEPTION(flag, "device");
+			}
+		} else {
+			tz->trips.passive.flags.valid = 0;
+			ACPI_EXCEPTION((AE_INFO, status, "Invalid passiv trip"
+					" point\n"));
 		}
 	}
 	if ((flag & ACPI_TRIPS_PASSIVE) || (flag & ACPI_TRIPS_DEVICES)) {



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-03-07  1:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-06 22:33 [PATCH] Do copy passive devices only if they are valid Thomas Renninger
2008-03-07  1:07 ` Zhang, Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox