thinkpad_acpi: Silence an uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Apr 2016 14:46:34 +0000 (17:46 +0300)
committerDarren Hart <dvhart@linux.intel.com>
Fri, 15 Apr 2016 15:27:15 +0000 (08:27 -0700)
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>
drivers/platform/x86/thinkpad_acpi.c

index e305ab541a2227e1f94ff3e80a0da369ed385946..9255ff3ee81ac74e5fc269f256aed955132e730d 100644 (file)
@@ -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)