summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/hp_accel.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-04-15 16:47:20 +0200
committerDarren Hart <dvhart@linux.intel.com>2016-04-15 17:26:25 +0200
commitff22b4806dd79ba06c78255b67e73c10e34d47cc (patch)
treef21c84edd8e7640ad21a957b9173d79704084b51 /drivers/platform/x86/hp_accel.c
parenthp_accel: Add support for HP ProBook 440 G3 (diff)
downloadlinux-ff22b4806dd79ba06c78255b67e73c10e34d47cc.tar.xz
linux-ff22b4806dd79ba06c78255b67e73c10e34d47cc.zip
hp_accel: Silence an uninitialized variable warning
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>
Diffstat (limited to 'drivers/platform/x86/hp_accel.c')
-rw-r--r--drivers/platform/x86/hp_accel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index 263002ba43eb..09356684c32f 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -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;
}
/**