diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-04-15 17:46:34 +0300 |
---|---|---|
committer | Darren Hart <dvhart@linux.intel.com> | 2016-04-15 18:27:15 +0300 |
commit | a7718360d91eedbedd58978ec8fff4a67a866f86 (patch) | |
tree | 8f2358ae1a2554536229954c45509d1ce530e504 /drivers/platform | |
parent | d0192dca2d6b64c043db5babb40076d13a6e955b (diff) | |
download | linux-a7718360d91eedbedd58978ec8fff4a67a866f86.tar.xz |
thinkpad_acpi: Silence an uninitialized variable warning
If fan_get_status() fails then "s" is not initialized. Tweak the error
handling a bit to silence this warning.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/thinkpad_acpi.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index e305ab541a22..9255ff3ee81a 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) |