* [patch] thinkpad_acpi: silence an unintialized variable warning
@ 2016-04-15 14:46 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread
* [patch] thinkpad_acpi: silence an unintialized variable warning
@ 2016-04-15 14:46 ` Dan Carpenter
0 siblings, 0 replies; 2+ messages 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] 2+ messages in thread
end of thread, other threads:[~2016-04-15 14:46 UTC | newest]
Thread overview: 2+ messages (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
2016-04-15 14:46 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.