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

[email protected]
Newsgroups org.infradead.lists.linux-amlogic
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The patch modifies the error path to purportedly free the `aiu-formatter` resource by jumping to the `err` label, referencing commit 83b83024cdbfd. However, the `aiu-formatter` allocation and cleanup code (specifically `gx_formatter_create` and `gx_formatter_free`) does not exist in the codebase at this revision. The patch is a "ghost fix" attempting to resolve a resource leak for a feature that is missing in this tree.
--

--- Patch [1]: [PATCH] ASoC: meson: aiu: Fix resource leak ---
commit e1f43f4a59c62657488472af87aa2e5d80576b03
Author: Ethan Tidmore <[email protected]>

ASoC: meson: aiu: Fix resource leak

This commit changes an error path in aiu_probe() to use a goto label
instead of returning directly. The commit message indicates this is to
ensure the aiu-formatter is properly freed when component registration
fails.

> diff --git a/sound/soc/meson/aiu.c b/sound/soc/meson/aiu.c
> index f2890111c1d2c..1cfa165fb9cfc 100644
> --- a/sound/soc/meson/aiu.c
> +++ b/sound/soc/meson/aiu.c

[ ... ]

> @@ -288,7 +288,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;

[Severity: Medium]
Is there a missing dependency for this patch, or is it an incomplete
backport?

The commit message mentions that the aiu-formatter is not being freed.
However, looking at aiu_probe() in this tree, there is no aiu-formatter
allocation or cleanup code present anywhere in the function.

>  	}
>  
>  	/* Register the hdmi codec control component */

[ ... ]

>  err:
>  	snd_soc_unregister_component(dev);
>  	return ret;
>  }

[Severity: Medium]
At this error label, only snd_soc_unregister_component() is called,
and no formatter cleanup logic exists. Does this fix apply to a
different tree where the formatter feature is actually present?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1

_______________________________________________
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.