From: Mikhail Dmitrichenko <mdmitrichenko@astralinux.ru>
To: stable@vger.kernel.org, Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Mikhail Dmitrichenko <mdmitrichenko@astralinux.ru>,
Sasha Levin <sashal@kernel.org>, Schspa Shi <schspa@gmail.com>,
Lucas Tsai <lucas_tsai@richtek.com>,
Sebastian Reichel <sre@kernel.org>,
Rhyland Klein <rklein@nvidia.com>,
Anton Vorontsov <anton@enomsg.org>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
lvc-project@linuxtesting.org,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH 5.10/5.15 1/2] power: supply: Fix typo in power_supply_check_supplies
Date: Mon, 2 Nov 2026 14:12:31 +0300 [thread overview]
Message-ID: <20261102111233.383-2-mdmitrichenko@astralinux.ru> (raw)
In-Reply-To: <20261102111233.383-1-mdmitrichenko@astralinux.ru>
From: Schspa Shi <schspa@gmail.com>
commit 966f6551173ac46183db6621451702a7e4a3d4b5 upstream.
It seems to be a typo, there is no actual BUG, but it's better to
fix it to avoid any possible BUG after we change the type of
supplied_from.
Signed-off-by: Schspa Shi <schspa@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Stable-dep-of: ba61aed9a346 ("power: supply: core: fix supplied_from allocations")
Signed-off-by: Mikhail Dmitrichenko <mdmitrichenko@astralinux.ru>
---
Prerequisite for the CVE-2026-74271 fix.
drivers/power/supply/power_supply_core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c
index 61ba2b343b93..d63cd225d4d4 100644
--- a/drivers/power/supply/power_supply_core.c
+++ b/drivers/power/supply/power_supply_core.c
@@ -261,13 +261,13 @@ static int power_supply_check_supplies(struct power_supply *psy)
return 0;
/* All supplies found, allocate char ** array for filling */
- psy->supplied_from = devm_kzalloc(&psy->dev, sizeof(psy->supplied_from),
+ psy->supplied_from = devm_kzalloc(&psy->dev, sizeof(*psy->supplied_from),
GFP_KERNEL);
if (!psy->supplied_from)
return -ENOMEM;
*psy->supplied_from = devm_kcalloc(&psy->dev,
- cnt - 1, sizeof(char *),
+ cnt - 1, sizeof(**psy->supplied_from),
GFP_KERNEL);
if (!*psy->supplied_from)
return -ENOMEM;
--
2.43.0
next prev parent reply other threads:[~2026-11-02 11:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 11:12 [PATCH 5.10/5.15 0/2] power: supply: Fix supplied_from allocation Mikhail Dmitrichenko
2026-11-02 11:12 ` Mikhail Dmitrichenko [this message]
2026-11-02 11:12 ` [PATCH 5.10/5.15 2/2] power: supply: core: fix supplied_from allocations Mikhail Dmitrichenko
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=20261102111233.383-2-mdmitrichenko@astralinux.ru \
--to=mdmitrichenko@astralinux.ru \
--cc=anton@enomsg.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lucas_tsai@richtek.com \
--cc=lvc-project@linuxtesting.org \
--cc=rklein@nvidia.com \
--cc=sashal@kernel.org \
--cc=schspa@gmail.com \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
--cc=stable@vger.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®