ASoC: hdac_hda: Fix hlink refcount leak on component registration failure
Subsystems (2)
PATCH 1/1 ASoC: hdac_hda: Fix hlink refcount leak on component registration failure
From: Haoxiang Li <[email protected]>
[ Upstream commit 6ad4892c4f5cb437a928a02f5b7d37d496aa9268 ]
hdac_hda_dev_probe() gets the HDA link with snd_hdac_ext_bus_link_get() before registering the ASoC component. If component registration fails, the function returns without dropping the link reference.
Always call snd_hdac_ext_bus_link_put() after the registration attempt so the reference taken during probe is balanced on both success and failure.
---
Hi,
Please consider this backport of the fix for CVE-2026-89944 to 6.6.y.
The code changes are identical to upstream.
The complete fix is already present in 6.12.y, 6.18.y and 7.2.y.
Build-tested only as part of a cumulative 6.6.y series: x86_64 objects (allmodconfig, CONFIG_WERROR=y); no runtime testing.
Thanks,
Artem Dinaburg
sound/soc/codecs/hdac_hda.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
sound/soc/codecs/hdac_hda.c +1 -3
@@ -612,10 +612,8 @@ static int hdac_hda_dev_probe(struct hdac_device *hdev) &hdac_hda_codec, hdac_hda_dais, ARRAY_SIZE(hdac_hda_dais)); -if (ret <0 ) { +if (ret <0 )dev_err (&hdev->dev,"failed to register HDA codec %d\n" , ret); -return ret; - }snd_hdac_ext_bus_link_put (hdev->bus, hlink);
Quoted 3 lines
hdac_hda_dev_probe()gets the HDA link withsnd_hdac_ext_bus_link_get()before registering the ASoC component. If component registration fails, the function returns without dropping the link reference.
Queued for 6.6, thanks.
Signature · 2 lines
Thanks, Sasha