power: supply: fix work-vs-devres teardown use-after-free
Status from this message: Applied, thanks!
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest3 patches 1 replyApplied
- v13 patches 2 repliesSuperseded
Changes in v2 from the cover letter
- trim the commit messages down to the bug and the fix
- drop the inline comments
- no code change vs v1 other than that comment removal
Patches in v2 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | power: supply: ltc2941: drain poll work before unregistering the supplydrivers/ | +5 | 0 replies | |
| 2/3 | power: supply: axp20x_usb_power: drain vbus_detect work before unregistering the supplydrivers/ | +5 | 0 replies | |
| 3/3 | power: supply: mt6360_charger: drain chrdet_work before unregistering the supplydrivers/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 0/3] power: supply: fix work-vs-devres teardown use-after-free
From: Hyunjung Ko <[email protected]>
Three power-supply drivers register a poll/detect work for devm cancellation before devm_power_supply_register(). devres unwinds in reverse, so on unbind the power supply is freed before the work is cancelled, and the work's power_supply_changed() then dereferences the freed supply. Each patch moves the devm work-cancel registration to after devm_power_supply_register() so teardown drains the work first. No functional change.
v2 (thanks Sebastian Reichel):
- trim the commit messages down to the bug and the fix
- drop the inline comments
- no code change vs v1 other than that comment removal
Hyunjung Ko (3):
power: supply: ltc2941: drain poll work before unregistering the supply
power: supply: axp20x_usb_power: drain vbus_detect work before
unregistering the supply
power: supply: mt6360_charger: drain chrdet_work before unregistering
the supply
drivers/power/supply/axp20x_usb_power.c | 10 +++++----- drivers/power/supply/ltc2941-battery-gauge.c | 10 +++++----- drivers/power/supply/mt6360_charger.c | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-)
Signature · 1 line
2.43.0