From: Waqar Hameed <waqar.hameed@axis.com>
To: Sebastian Reichel <sre@kernel.org>,
Anton Vorontsov <avorontsov@ru.mvista.com>,
Marek Vasut <marek.vasut@gmail.com>
Cc: <kernel@axis.com>, <linux-pm@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
Date: Sat, 20 Dec 2025 23:46:24 +0100 [thread overview]
Message-ID: <cover.1766270196.git.waqar.hameed@axis.com> (raw)
The majority of the drivers in `drivers/power/supply/` do the right
thing when registering an interrupt handler and the `power_supply`
handle; namely making sure that the interrupt handler only runs while
the `power_supply` handle is valid. This driver requests the IRQ a
little too soon, and this can lead to a nasty NULL pointer dereference
as thoroughly explained in the commit message. This patch series also
contains some other related clean-ups that makes life a little easier.
This issue was found when writing a new driver for the upcoming TI
BQ25630 [1]. Patch adding support for that one will be sent as soon as
TI releases the datasheet publicly, which should be anytime soon...
[1] https://www.ti.com/product/BQ25630
Waqar Hameed (3):
power: supply: wm97xx: Fix NULL pointer dereference in
power_supply_changed()
power: supply: wm97xx: Use devm_power_supply_register()
power: supply: wm97xx: Use devm_kcalloc()
drivers/power/supply/wm97xx_battery.c | 40 ++++++++++-----------------
1 file changed, 15 insertions(+), 25 deletions(-)
base-commit: fa084c35afa13ab07a860ef0936cd987f9aa0460
--
2.39.5
next reply other threads:[~2025-12-20 22:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-20 22:46 Waqar Hameed [this message]
2025-12-20 22:46 ` [PATCH 2/3] power: supply: wm97xx: Use devm_power_supply_register() Waqar Hameed
2025-12-20 22:46 ` [PATCH 1/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed() Waqar Hameed
2025-12-20 22:46 ` [PATCH 3/3] power: supply: wm97xx: Use devm_kcalloc() Waqar Hameed
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=cover.1766270196.git.waqar.hameed@axis.com \
--to=waqar.hameed@axis.com \
--cc=avorontsov@ru.mvista.com \
--cc=kernel@axis.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).