[PATCH] ALSA: hda/tegra: fix a memory leak in hda_tegra_first_init()

From: Haoxiang Li

Date: Sun Dec 28 2025 - 09:06:03 EST


Add azx_free_stream_pages() to release the resources allocated
by azx_alloc_stream_pages().

Signed-off-by: Haoxiang Li <lihaoxiang@xxxxxxxxxxxxxxxx>
---
sound/hda/controllers/tegra.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/sound/hda/controllers/tegra.c b/sound/hda/controllers/tegra.c
index 6ab338f37db5..656cbd88b9aa 100644
--- a/sound/hda/controllers/tegra.c
+++ b/sound/hda/controllers/tegra.c
@@ -380,6 +380,7 @@ static int hda_tegra_first_init(struct azx *chip, struct platform_device *pdev)
/* codec detection */
if (!bus->codec_mask) {
dev_err(card->dev, "no codecs found!\n");
+ azx_free_stream_pages(chip);
return -ENODEV;
}

--
2.25.1