[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SE5P216MB338062940EAC0E6E82C3080FFCA8A@SE5P216MB3380.KORP216.PROD.OUTLOOK.COM>
Date: Thu, 18 Dec 2025 02:06:22 +0000
From: "vulab@...as.ac.cn" <vulab@...as.ac.cn>
To: Mark Brown <broonie@...nel.org>
CC: "shenghao-ding@...com" <shenghao-ding@...com>, "kevin-lu@...com"
<kevin-lu@...com>, "baojun.xu@...com" <baojun.xu@...com>,
"lgirdwood@...il.com" <lgirdwood@...il.com>, "perex@...ex.cz"
<perex@...ex.cz>, "tiwai@...e.com" <tiwai@...e.com>,
"linux-sound@...r.kernel.org" <linux-sound@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject:
回复: [PATCH] ASoC: tlv320aic32x4: Fix missing error check for devm_clk_register()
Thanks for the review.
I realized I missed the braces { } for the loop in the previous patch, which was a critical syntax error. I will fix this in v2.
Regarding the leak concern: The helper aic32x4_register_clk() internally uses devm_clk_register().
If this function returns an error and propagates it up to the probe function, the driver core should
automatically unregister any clocks successfully registered in previous loop iterations.
Therefore, I believe explicit unregister is not needed here,
but please correct me if I'm wrong regarding the devm behavior.
--
With best wishes
Haotian Zhang
________________________________________
发件人: Mark Brown
已发送: 2025 年 12 月 17 日 星期三 19:58
收件人: Haotian Zhang
抄送: Shenghao Ding; Kevin Lu; Baojun Xu; Liam Girdwood; Jaroslav Kysela; Takashi Iwai; linux-sound@...r.kernel.org; linux-kernel@...r.kernel.org
主题: Re: [PATCH] ASoC: tlv320aic32x4: Fix missing error check for devm_clk_register()
On Wed, Dec 17, 2025 at 10:50:51AM +0800, Haotian Zhang wrote:
> for (i = 0; i < ARRAY_SIZE(aic32x4_clkdesc_array); ++i)
> - aic32x4_register_clk(dev, &aic32x4_clkdesc_array[i]);
> + clk = aic32x4_register_clk(dev, &aic32x4_clkdesc_array[i]);
> + if (IS_ERR(clk))
> + return PTR_ERR(clk);
If an error does happen this will leak all the previously registered
clocks.
Powered by blists - more mailing lists