From: Dave Jones Again, found with coverity's checker. Signed-off-by: Dave Jones Signed-off-by: Andrew Morton --- 25-akpm/drivers/acpi/thermal.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) diff -puN drivers/acpi/thermal.c~pointer-dereference-before-null-check-in-acpi-thermal-driver drivers/acpi/thermal.c --- 25/drivers/acpi/thermal.c~pointer-dereference-before-null-check-in-acpi-thermal-driver 2004-09-03 23:44:33.392027624 -0700 +++ 25-akpm/drivers/acpi/thermal.c 2004-09-03 23:44:33.396027016 -0700 @@ -659,7 +659,7 @@ acpi_thermal_check ( struct acpi_thermal *tz = (struct acpi_thermal *) data; unsigned long sleep_time = 0; int i = 0; - struct acpi_thermal_state state = tz->state; + struct acpi_thermal_state state; ACPI_FUNCTION_TRACE("acpi_thermal_check"); @@ -668,6 +668,8 @@ acpi_thermal_check ( return_VOID; } + state = tz->state; + result = acpi_thermal_get_temperature(tz); if (result) return_VOID; _