Skip to contentSkip to conversation

thinkpad_acpi: silence an unintialized variable warning

PATCH New Dan Carpenter 1 participant 1 message Apr 15, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thinkpad_acpi: silence an unintialized variable warning

If fan_get_status() fails then "s" isn't initialized. I've tweaked the error handling a bit to silence this warning.

drivers/platform/x86/thinkpad_acpi.c +3 -1
index e305ab5..9255ff3 100644
@@ -7972,10 +7972,12 @@ static int fan_get_status_safe(u8 *status)
 		fan_update_desired_level(s);
 	mutex_unlock(&fan_mutex);
 
+	if (rc)
+		return rc;
 	if (status)
 		*status = s;
 
-	return rc;
+	return 0;
 }
 
 static int fan_get_speed(unsigned int *speed)