diff options
| author | Chancel Liu <chancel.liu@nxp.com> | 2026-09-13 19:15:26 +0900 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-14 14:57:28 +0100 |
| commit | b9e5343ba72a07a12d364e8ba6874e2a8fb617c6 (patch) | |
| tree | 6f3c2f23ff03024c966fa5ed50be3fcbab136e2c /tools/perf/scripts/python | |
| parent | fd73f4a6659897191fa0d40695fe370925dd3780 (diff) | |
ASoC: wm8962: Fix regulator notifier and beep leaks on card re-bind
wm8962 registers its regulator disable notifiers and allocates its beep
input device from the ASoC component probe, but the associated devres
cleanup is tied to the underlying I2C device.
These resources are only leaked when the sound card is unregistered and
re-registered while the I2C device stays bound. On that path the
component probe runs again and:
- re-registers the same notifier_block on the still-registered
regulator notifier chain, which triggers
notifier callback wm8962_regulator_event_N already registered
WARNING: ... at kernel/notifier.c:23 notifier_chain_register
and corrupts the chain.
- allocates and registers a new beep input device every time while
wm8962_free_beep() only clears the pointer, leaking the previous
input device and its sysfs/input node.
Fix both:
- Move the regulator notifier registration to wm8962_i2c_probe() so it
runs once per I2C device bind.
- Allocate the beep device with input_allocate_device() and pair it
with the component lifecycle: input_free_device() on registration
failure and input_unregister_device() in wm8962_free_beep().
Signed-off-by: Chancel Liu <chancel.liu@nxp.com>
Link: https://patch.msgid.link/20260913101531.2787654-2-chancel.liu@oss.nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
