[PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()

Waqar Hameed posted 3 patches 1 month, 2 weeks ago
drivers/power/supply/wm97xx_battery.c | 40 ++++++++++-----------------
1 file changed, 15 insertions(+), 25 deletions(-)
[PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
Posted by Waqar Hameed 1 month, 2 weeks ago
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
Re: (subset) [PATCH 0/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
Posted by Sebastian Reichel 3 weeks, 5 days ago
On Sat, 20 Dec 2025 23:46:24 +0100, Waqar Hameed wrote:
> 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.
> 
> [...]

Applied, thanks!

[1/3] power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
      commit: 39fe0eac6d755ef215026518985fcf8de9360e9e

Best regards,
-- 
Sebastian Reichel <sebastian.reichel@collabora.com>