[PATCH] ASoC: fsl: pcm030: release the platform node reference
From: Yige Jiang
Date: Tue Nov 03 2026 - 14:04:53 EST
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.
Fixes: 084011615c1c ("ASoC: fsl: pcm030-audio-fabric use snd_soc_register_card")
Assisted-by: LLM
Signed-off-by: Yige Jiang <yigejiang86@xxxxxxxxx>
---
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(+)
diff --git a/sound/soc/fsl/pcm030-audio-fabric.c b/sound/soc/fsl/pcm030-audio-fabric.c
index a7a5dba83a2f..64d9f7e34611 100644
--- a/sound/soc/fsl/pcm030-audio-fabric.c
+++ b/sound/soc/fsl/pcm030-audio-fabric.c
@@ -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