Skip to contentSkip to conversation

Pointer dereference before NULL check in ACPI thermal driver.

PATCH Dave Jones 1 participant 1 message Sep 3, 2004

Subsystems (2)
lore
Share & tools
lore

Dave Jones

author
#0 lore raw

Again, found with coverity's checker.

drivers/acpi/thermal.c renamed from drivers/acpi/thermal.c~ +3 -1
@@ -659,7 +659,7 @@
 	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 @@
 		return_VOID;
 	}
 
+	state = tz->state;
+
 	result = acpi_thermal_get_temperature(tz);
 	if (result)
 		return_VOID;