ASoC: fsl: pcm030: release the platform node reference
PATCH 1/1 ASoC: fsl: pcm030: release the platform node reference
pcm030_fabric_probe() gets a platform node reference and shares it between two DAI links. Neither probe failures nor card removal release this reference. The links borrow the node; assigning the pointer twice does not acquire another reference.
Register a managed put action after acquiring the node. This covers later probe failures and releases the reference after the card and codec are unregistered on unbind. If registering the action fails, the reset variant releases the reference immediately.
---
Based on linux-next next-20261102 (2637bdec0535).
Compile-tested: powerpc, GCC 14.2.0, W=1, CONFIG_OF_DYNAMIC=y. CONFIG_SND_MPC52xx_SOC_PCM030=m.
Baseline and patched target objects built from this exact base. No full kernel/module-link, hardware or runtime test was performed. AI assistance: Codex (LLM) for ownership analysis, code and changelog.
sound/soc/fsl/pcm030-audio-fabric.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
sound/soc/fsl/pcm030-audio-fabric.c +10 -0
@@ -50,6 +50,11 @@ static struct snd_soc_card pcm030_card = { .num_links = ARRAY_SIZE(pcm030_fabric_dai), }; +static void pcm030_put_platform_node (void *data) +{ +of_node_put (data); +} +static int pcm030_fabric_probe (struct platform_device *op) {struct device_node *np = op->dev.of_node;
@@ -78,6 +83,11 @@ static int pcm030_fabric_probe(struct platform_device *op)return -ENODEV ; } + ret =devm_add_action_or_reset (&op->dev, pcm030_put_platform_node, + platform_np); +if (ret) +return ret; +for_each_card_prelinks (card, i, dai_link) dai_link->platforms->of_node = platform_np;
base-commit: 2637bdec0535a2044cd830eba9a79363651d9043
Mark Brown
maintainerQuoted 1 line · Yige Jiang
ASoC: fsl: pcm030: release the platform node reference
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5
Thanks!
[1/1] ASoC: fsl: pcm030: release the platform node reference
https://git.kernel.org/broonie/sound/c/c526eaad1ada
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark