From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:44956 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942561AbcJ1SRa (ORCPT ); Fri, 28 Oct 2016 14:17:30 -0400 Subject: Patch "power: bq24257: Fix use of uninitialized pointer bq->charger" has been added to the 4.4-stable tree To: savoundg@gmail.com, chanot.a@gmail.com, dannenberg@ti.com, dwmw2@infradead.org, gregkh@linuxfoundation.org, sre@kernel.org Cc: , From: Date: Fri, 28 Oct 2016 14:17:37 -0400 Message-ID: <147767865724776@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 0610735928ee47870e083d5901caa371089216f1 Mon Sep 17 00:00:00 2001 From: Georges Savoundararadj Date: Wed, 7 Sep 2016 18:38:15 -0700 Subject: power: bq24257: Fix use of uninitialized pointer bq->charger From: Georges Savoundararadj 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 Cc: Aurelien Chanot Cc: Andreas Dannenberg Cc: Sebastian Reichel Cc: David Woodhouse Fixes: 2219a935963e ("power_supply: Add TI BQ24257 charger driver") Signed-off-by: Sebastian Reichel Signed-off-by: Greg Kroah-Hartman --- 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"); Patches currently in stable-queue which might be from savoundg@gmail.com are queue-4.4/power-bq24257-fix-use-of-uninitialized-pointer-bq-charger.patch