From: Dan Carpenter Date: Fri, 15 Apr 2016 14:47:20 +0000 (+0300) Subject: hp_accel: Silence an uninitialized variable warning X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ff22b4806dd79ba06c78255b67e73c10e34d47cc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Darren Hart --- 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; } /**