imx_sgtl5000_probe() takes a reference on the codec i2c device, but the
successful probe path returns without releasing it. Only the error
paths drop the reference, so every successful probe leaks the i2c
client device.

Release the reference once the card has been registered.

Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000")
Cc: [email protected]
Assisted-by: DeepSeek-V4.1-Flash and OpenAI Codex
Signed-off-by: Wentao Liang <[email protected]>
---
 sound/soc/fsl/imx-sgtl5000.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 8bcf54ef709e..8ce333eb47fe 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -177,6 +177,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
                goto put_device;
        }
 
+       put_device(&codec_dev->dev);
+
        of_node_put(ssi_np);
        of_node_put(codec_np);
 
-- 
2.34.1


Reply via email to