[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20160415144634.GE8953@mwanda>
Date: Fri, 15 Apr 2016 17:46:34 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Henrique de Moraes Holschuh <ibm-acpi@....eng.br>
Cc: Darren Hart <dvhart@...radead.org>,
ibm-acpi-devel@...ts.sourceforge.net,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [patch] 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.
Signed-off-by: Dan Carpenter <dan.carpenter@...cle.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)
Powered by blists - more mailing lists