* [patch] thinkpad_acpi: silence an unintialized variable warning
@ 2016-04-15 14:46 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-04-15 14:46 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Darren Hart, ibm-acpi-devel, platform-driver-x86, linux-kernel,
kernel-janitors
If fan_get_status() fails then "s" isn't initialized. I've tweaked the
error handling a bit to silence this warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e305ab5..9255ff3 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -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)
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-15 14:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-15 14:46 [patch] thinkpad_acpi: silence an unintialized variable warning Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox