Skip to content

power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()

Waqar Hameed linux-pm lkml 1 version Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()drivers/power/supply/wm97xx_battery.c+19 -150 replies
2/3power: supply: wm97xx: Use devm_power_supply_register()drivers/power/supply/wm97xx_battery.c+2 -62 replies
3/3power: supply: wm97xx: Use devm_kcalloc()drivers/power/supply/wm97xx_battery.c+8 -180 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

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

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

Signature · 1 line
2.39.5