[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20161029134924.119344282@linuxfoundation.org>
Date: Sat, 29 Oct 2016 09:49:39 -0400
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
Georges Savoundararadj <savoundg@...il.com>,
Aurelien Chanot <chanot.a@...il.com>,
Andreas Dannenberg <dannenberg@...com>,
Sebastian Reichel <sre@...nel.org>,
David Woodhouse <dwmw2@...radead.org>
Subject: [PATCH 4.4 38/51] power: bq24257: Fix use of uninitialized pointer bq->charger
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Georges Savoundararadj <savoundg@...il.com>
commit 0610735928ee47870e083d5901caa371089216f1 upstream.
bq->charger is initialized in bq24257_power_supply_init.
Therefore, bq24257_power_supply_init should be called before the
registration of the IRQ handler bq24257_irq_handler_thread that calls
power_supply_changed(bq->charger).
Signed-off-by: Georges Savoundararadj <savoundg@...il.com>
Cc: Aurelien Chanot <chanot.a@...il.com>
Cc: Andreas Dannenberg <dannenberg@...com>
Cc: Sebastian Reichel <sre@...nel.org>
Cc: David Woodhouse <dwmw2@...radead.org>
Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver")
Signed-off-by: Sebastian Reichel <sre@...nel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
drivers/power/bq24257_charger.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- a/drivers/power/bq24257_charger.c
+++ b/drivers/power/bq24257_charger.c
@@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_clie
return ret;
}
+ ret = bq24257_power_supply_init(bq);
+ if (ret < 0) {
+ dev_err(dev, "Failed to register power supply\n");
+ return ret;
+ }
+
ret = devm_request_threaded_irq(dev, client->irq, NULL,
bq24257_irq_handler_thread,
IRQF_TRIGGER_FALLING |
@@ -1078,12 +1084,6 @@ static int bq24257_probe(struct i2c_clie
return ret;
}
- ret = bq24257_power_supply_init(bq);
- if (ret < 0) {
- dev_err(dev, "Failed to register power supply\n");
- return ret;
- }
-
ret = sysfs_create_group(&bq->charger->dev.kobj, &bq24257_attr_group);
if (ret < 0) {
dev_err(dev, "Can't create sysfs entries\n");
Powered by blists - more mailing lists