public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
@ 2025-12-20 22:46 Waqar Hameed
  2025-12-20 22:46 ` [PATCH 2/3] power: supply: wm97xx: Use devm_power_supply_register() Waqar Hameed
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Waqar Hameed @ 2025-12-20 22:46 UTC (permalink / raw)
  To: Sebastian Reichel, Anton Vorontsov, Marek Vasut
  Cc: kernel, linux-pm, linux-kernel

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-01-14 10:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-20 22:46 [PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed() Waqar Hameed
2025-12-20 22:46 ` [PATCH 2/3] power: supply: wm97xx: Use devm_power_supply_register() Waqar Hameed
2026-01-12  1:36   ` Sebastian Reichel
2026-01-14 10:51     ` 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
2026-01-12  1:56 ` (subset) [PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed() Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox