[PATCH] ASoC: meson: aiu: Fix resource leak

Ethan Tidmore <[email protected]>
Newsgroups org.infradead.lists.linux-amlogic,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-sound
Message-ID <[email protected]>
In snd_soc_register_component() error path, the aiu-formatter is not
being freed. Instead of returning now goto the err tag so the
aiu-formatter can properly be freed.

Fixes: 83b83024cdbfd ("ASoC: meson: aiu: use aiu-formatter-i2s to format I2S output data")
Signed-off-by: Ethan Tidmore <[email protected]>
---
 sound/soc/meson/aiu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
index 64ace4d25d92..d6b644a53f7e 100644
--- a/sound/soc/meson/aiu.c
+++ b/sound/soc/meson/aiu.c
@@ -310,7 +310,7 @@ static int aiu_probe(struct platform_device *pdev)
 					 ARRAY_SIZE(aiu_cpu_dai_drv));
 	if (ret) {
 		dev_err(dev, "Failed to register cpu component\n");
-		return ret;
+		goto err;
 	}
 
 	/* Register the hdmi codec control component */
-- 
Thanks,
ET
https://github.com/sponsors/ethantidmore


_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.