Patch "power: bq24257: Fix use of uninitialized pointer bq->charger" has been added to the 4.4-stable tree
This is a note to let you know that I've just added the patch titled
power: bq24257: Fix use of uninitialized pointer bq->charger
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
0610735928ee47870e083d5901caa371089216f1Mon Sep 17 00:00:00 2001
From: Georges Savoundararadj <[email protected]>
Date: Wed, 7 Sep 2016 18:38:15 -0700
Subject: power: bq24257: Fix use of uninitialized pointer bq->charger
From: Georges Savoundararadj <[email protected]>
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).
--- drivers/power/bq24257_charger.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/power/bq24257_charger.c +6 -6
@@ -1068,6 +1068,12 @@ static int bq24257_probe(struct i2c_cliereturn 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_cliereturn 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" );
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch