diff options
| author | Mark Brown <broonie@kernel.org> | 2026-09-14 14:57:29 +0100 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-09-14 14:57:29 +0100 |
| commit | d4158f3ee4f09c5001716765d135132e4b40b63a (patch) | |
| tree | f583efcc7af3dc8228f72bc6522353b49e402102 /tools/perf/scripts/python/exported-sql-viewer.py | |
| parent | 81d2ec6f924e08efde646b60473997de0f568fd3 (diff) | |
| parent | c5907dcc13ad09c577534ad4ecacce4ba482156e (diff) | |
ASoC: codecs: Fix resource leaks on card re-bind
Chancel Liu <chancel.liu@oss.nxp.com> says:
Several ASoC codec drivers set up per-device resources from their ASoC
component probe, but the associated cleanup is tied to the underlying bus
(I2C/SPI) device rather than being balanced per component probe. This is
fine for a plain probe/remove, but it breaks when the sound card is
unregistered and re-registered while the bus device stays bound (a card
re-bind): the component probe runs again while the previous bus-level
resources are still live.
Two kinds of resources are affected:
- Regulator disable notifiers (wm8962, wm8995, tlv320aic31xx,
tlv320aic3x)
The same notifier_block is re-registered on the
still-registered regulator notifier chain, which triggers
notifier callback ..._regulator_event_N already registered
WARNING: ... at kernel/notifier.c:23 notifier_chain_register
and corrupts the chain.
- Beep input devices (wm8962, cs42l52, cs42l56)
A new input device is allocated and registered on every component
probe while the free path only clears the pointer, leaking the
previous input device and its sysfs/input node.
The two problems need opposite fixes: the notifiers are registered from
the component probe, so the registration is moved to the bus probe so it
runs once per bus bind; the beep device is freed from the component
remove path, so it is switched from devm_input_allocate_device() to
input_allocate_device() paired with an explicit
input_unregister_device() on that same free path.
Verified with wm8962. The remaining patches fix other codec drivers
following the same patterns.
Link: https://patch.msgid.link/20260913101531.2787654-1-chancel.liu@oss.nxp.com
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions
