[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170914155051.8289-15-alexander.levin@verizon.com>
Date: Thu, 14 Sep 2017 15:51:08 +0000
From: "Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Cc: Hans de Goede <hdegoede@...hat.com>,
Sebastian Reichel <sre@...nel.org>,
"Levin, Alexander (Sasha Levin)" <alexander.levin@...izon.com>
Subject: [PATCH for 4.9 15/59] power: supply: axp288_fuel_gauge: Fix
fuel_gauge_reg_readb return on error
From: Hans de Goede <hdegoede@...hat.com>
[ Upstream commit 6f074bc878dc9b00c0df0bf3a8cb1d9e294cd881 ]
If reading the register fails, return the actual error code, instead
of the uninitialized val variable;
Signed-off-by: Hans de Goede <hdegoede@...hat.com>
Signed-off-by: Sebastian Reichel <sre@...nel.org>
Signed-off-by: Sasha Levin <alexander.levin@...izon.com>
---
drivers/power/supply/axp288_fuel_gauge.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
index 5bdde692f724..f62f9dfea984 100644
--- a/drivers/power/supply/axp288_fuel_gauge.c
+++ b/drivers/power/supply/axp288_fuel_gauge.c
@@ -169,8 +169,10 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg)
break;
}
- if (ret < 0)
+ if (ret < 0) {
dev_err(&info->pdev->dev, "axp288 reg read err:%d\n", ret);
+ return ret;
+ }
return val;
}
--
2.11.0
Powered by blists - more mailing lists