hp_accel: Silence an uninitialized variable warning
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Apr 2016 14:47:20 +0000 (17:47 +0300)
committerDarren Hart <dvhart@linux.intel.com>
Fri, 15 Apr 2016 15:26:25 +0000 (08:26 -0700)
If acpi_evaluate_integer() fails then "lret" isn't initialized.  I've
tweaked the error handling to avoid this issue.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
drivers/platform/x86/hp_accel.c

index 263002ba43ebcfd69bffc01abf5f4c635d9c0b2c..09356684c32f6a78f03dbc5ef1dd7addc828bf08 100644 (file)
@@ -127,8 +127,10 @@ static int lis3lv02d_acpi_read(struct lis3lv02d *lis3, int reg, u8 *ret)
        arg0.integer.value = reg;
 
        status = acpi_evaluate_integer(dev->handle, "ALRD", &args, &lret);
+       if (ACPI_FAILURE(status))
+               return -EINVAL;
        *ret = lret;
-       return (status != AE_OK) ? -EINVAL : 0;
+       return 0;
 }
 
 /**