From: Amit Sunil Dhamne <amitsd@google.com>
To: Christian Loehle <christian.loehle@arm.com>, sre@kernel.org
Cc: linux-pm <linux-pm@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] power: supply: max77759: initialize registration, configurations
Date: Fri, 13 Nov 2026 14:57:16 -0800 [thread overview]
Message-ID: <0d02b1fc-a6a8-4250-9d59-b11a6d67cd21@google.com> (raw)
In-Reply-To: <e93f0875-7350-4208-b91a-4aeda1fa7cd7@arm.com>
On 11/9/26 3:14 PM, Christian Loehle wrote:
> Booting a Pixel 6 with CONFIG_INIT_STACK_NONE can oops in
> internal_create_group() while probing the MAX77759 charger. The probe
> only initializes fwnode and drv_data in its automatic power_supply_config.
> The power-supply core copies the uninitialized attr_grp into dev->groups,
> allowing sysfs to follow an invalid attribute-group pointer.
> The local regulator_config is also only partly initialized. Its unused
> init_data, regmap and ena_gpiod fields can be consumed by regulator core.
> Parsing the device tree does not initialize all of these fields.
>
> Zero-initialize them both configurations before used fields are
> assigned.
>
> Fixes: 70d7dd27f6dc ("power: supply: max77759: add charger driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
Reviewed-by: Amit Sunil Dhamne <amitsd@google.com>
> ---
> drivers/power/supply/max77759_charger.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/power/supply/max77759_charger.c b/drivers/power/supply/max77759_charger.c
> index a93adb266f01..e792327ff14f 100644
> --- a/drivers/power/supply/max77759_charger.c
> +++ b/drivers/power/supply/max77759_charger.c
> @@ -683,8 +683,8 @@ static void max_tcpci_unregister_psy_notifier(void *nb)
>
> static int max77759_charger_probe(struct platform_device *pdev)
> {
> - struct regulator_config chgin_otg_reg_cfg;
> - struct power_supply_config psy_cfg;
> + struct regulator_config chgin_otg_reg_cfg = {};
> + struct power_supply_config psy_cfg = {};
> struct device *dev = &pdev->dev;
> struct max77759_charger *chg;
> int ret;
prev parent reply other threads:[~2026-11-13 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 23:14 Christian Loehle
2026-11-13 22:57 ` Amit Sunil Dhamne [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d02b1fc-a6a8-4250-9d59-b11a6d67cd21@google.com \
--to=amitsd@google.com \
--cc=christian.loehle@arm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®