summaryrefslogtreecommitdiffstats
path: root/tools/perf/scripts/python/stackcollapse.py
diff options
context:
space:
mode:
authorWaqar Hameed <waqar.hameed@axis.com>2025-12-20 23:46:24 +0100
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-01-12 02:52:32 +0100
commit39fe0eac6d755ef215026518985fcf8de9360e9e (patch)
tree492fde222b7f1dbecca0de9859ed4c1904e47530 /tools/perf/scripts/python/stackcollapse.py
parent04aa3d6dddaf39ecc9735d0b62f46899db71d35e (diff)
downloadlinux-39fe0eac6d755ef215026518985fcf8de9360e9e.tar.gz
linux-39fe0eac6d755ef215026518985fcf8de9360e9e.zip
power: supply: wm97xx: Fix NULL pointer dereference in power_supply_changed()
In `probe()`, `request_irq()` is called before allocating/registering a `power_supply` handle. If an interrupt is fired between the call to `request_irq()` and `power_supply_register()`, the `power_supply` handle will be used uninitialized in `power_supply_changed()` in `wm97xx_bat_update()` (triggered from the interrupt handler). This will lead to a `NULL` pointer dereference since Fix this racy `NULL` pointer dereference by making sure the IRQ is requested _after_ the registration of the `power_supply` handle. Since the IRQ is the last thing requests in the `probe()` now, remove the error path for freeing it. Instead add one for unregistering the `power_supply` handle when IRQ request fails. Fixes: 7c87942aef52 ("wm97xx_battery: Use irq to detect charger state") Signed-off-by: Waqar Hameed <waqar.hameed@axis.com> Link: https://patch.msgid.link/97b55f0479a932eea7213844bf66f28a974e27a2.1766270196.git.waqar.hameed@axis.com Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions