[PATCH 0/4] ASoC: Do not leak allocations across card rebind

From: Arina Kharlamova via B4 Relay

Date: Tue Dec 01 2026 - 14:12:31 EST


These drivers allocate memory or get a supply with devm in a
callback that runs on every card bind, so each bind adds to what
stays allocated until the device itself is unbound. Move the
allocation to the device probe, or release it in the matching remove.

I found these with spec2patch. I model-checked the probe and remove
paths of each driver with CBMC against formal specifications of the
kernel APIs they call. The specifications are checked against the kernel
source, and some of them are proved in Rocq against a transcription of
the kernel code. I also checked lock usage separately. With the help of
an AI coding assistant (Claude); I reviewed the analysis and the fix.
Compile-tested only, not tested on hardware.

---
Arina Kharlamova (4):
ASoC: adau7002: Allocate private data in platform probe
ASoC: codecs: mt6358: Fix Avdd supply leak across card bind/unbind
ASoC: codecs: twl6040: Allocate private data in the platform probe
ASoC: ux500: Do not allocate the DMA data on every DAI probe

sound/soc/codecs/adau7002.c | 28 +++++++++++-----------------
sound/soc/codecs/mt6358.c | 19 +++++++++++++------
sound/soc/codecs/twl6040.c | 24 +++++++++++++-----------
sound/soc/ux500/ux500_msp_dai.c | 9 ++-------
sound/soc/ux500/ux500_msp_dai.h | 4 ++++
5 files changed, 43 insertions(+), 41 deletions(-)
---
base-commit: 20ee6031645dbed8ddf8f4833edf415f3760607f
change-id: 20261201-s2p-asoc-bind-9026b245e6a0

Best regards,
--
Arina Kharlamova <arina.kharlamova@xxxxxxxxxxxx>