diff options
author | Krzysztof Helt <krzysztof.h1@wp.pl> | 2008-04-08 20:41:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-08 21:25:52 -0400 |
commit | bb070e43497d4fcfea7d8b52003fe1376c218343 (patch) | |
tree | 7efb2a140fafb62eeb389ec8e8de499151aeede5 /drivers/acpi/thermal.c | |
parent | ef45cb624b9517f71ad6c61299478c2cc08e4d98 (diff) |
acpi thermal: fix result check
thermal_zone_device_register() uses the ERR_PTR macro on its return values. A
correct check is to use the IS_ERR() macro.
The 2.6.25 kernels panic on Compaq AP550 without this patch as it has more
then 10 (THERMAL_MAX_TRIPS) trip points (there are 12).
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Len Brown <lenb@kernel.org>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r-- | drivers/acpi/thermal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index c4e00ac8ea85..1bcecc7dd2ca 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -1125,7 +1125,7 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz) | |||
1125 | tz->trips.active[i].flags.valid; i++, trips++); | 1125 | tz->trips.active[i].flags.valid; i++, trips++); |
1126 | tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone", | 1126 | tz->thermal_zone = thermal_zone_device_register("ACPI thermal zone", |
1127 | trips, tz, &acpi_thermal_zone_ops); | 1127 | trips, tz, &acpi_thermal_zone_ops); |
1128 | if (!tz->thermal_zone) | 1128 | if (IS_ERR(tz->thermal_zone)) |
1129 | return -ENODEV; | 1129 | return -ENODEV; |
1130 | 1130 | ||
1131 | result = sysfs_create_link(&tz->device->dev.kobj, | 1131 | result = sysfs_create_link(&tz->device->dev.kobj, |