Linux ACPI
 help / color / mirror / Atom feed
From: Thomas Renninger <trenn@suse.de>
To: ming.m.lin@intel.com
Cc: "Zhang, Rui" <rui.zhang@intel.com>,
	linux-acpi <linux-acpi@vger.kernel.org>
Subject: [PATCH] Do copy passive devices only if they are valid
Date: Thu, 06 Mar 2008 23:33:47 +0100	[thread overview]
Message-ID: <1204842827.8741.7.camel@linux-2bdv.site> (raw)

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)) {



             reply	other threads:[~2008-03-06 22:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-06 22:33 Thomas Renninger [this message]
2008-03-07  1:07 ` [PATCH] Do copy passive devices only if they are valid Zhang, Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1204842827.8741.7.camel@linux-2bdv.site \
    --to=trenn@suse.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox