mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
ASoC: hdac_hda: Fix hlink refcount leak on component registration failure
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.
Fixes: 6bae5ea949 ("ASoC: hdac_hda: add asoc extension for legacy HDA codec drivers")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Link: https://patch.msgid.link/20260622145645.1184986-1-haoxiang_li2024@163.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
016f29997e
commit
6ad4892c4f
|
|
@ -642,10 +642,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, "%s: failed to register HDA codec %d\n", __func__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
snd_hdac_ext_bus_link_put(hdev->bus, hlink);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user