* [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
@ 2026-11-04 15:24 Richard Fitzgerald
2026-11-04 19:25 ` Mark Brown
2026-11-04 19:26 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Richard Fitzgerald @ 2026-11-04 15:24 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, linux-kernel, patches
If cs_dsp_power_up() fails on or after cs_dsp_load() mark the controls
disabled and free the alg regions.
Fixes: f6bc909e7673c ("firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
drivers/firmware/cirrus/cs_dsp.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/firmware/cirrus/cs_dsp.c b/drivers/firmware/cirrus/cs_dsp.c
index 844c68036975f..4dcce87685d33 100644
--- a/drivers/firmware/cirrus/cs_dsp.c
+++ b/drivers/firmware/cirrus/cs_dsp.c
@@ -2793,6 +2793,7 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
const struct firmware *coeff_firmware, const char *coeff_filename,
const char *fw_name)
{
+ struct cs_dsp_coeff_ctl *ctl;
int ret;
mutex_lock(&dsp->pwr_lock);
@@ -2838,6 +2839,11 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
return 0;
err_ena:
+ list_for_each_entry(ctl, &dsp->ctl_list, list)
+ ctl->enabled = 0;
+
+ cs_dsp_free_alg_regions(dsp);
+
if (dsp->ops->disable_core)
dsp->ops->disable_core(dsp);
err_mem:
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
2026-11-04 15:24 [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Richard Fitzgerald
@ 2026-11-04 19:25 ` Mark Brown
2026-11-04 19:26 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-11-04 19:25 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: broonie, linux-sound, linux-kernel, patches
> If cs_dsp_power_up() fails on or after cs_dsp_load() mark the controls
> disabled and free the alg regions.
> @@ -2838,6 +2839,11 @@ int cs_dsp_power_up(struct cs_dsp *dsp,
>
> return 0;
> err_ena:
> + list_for_each_entry(ctl, &dsp->ctl_list, list)
> + ctl->enabled = 0;
> +
> + cs_dsp_free_alg_regions(dsp);
> +
Do we need something similar in cs_dsp_adsp1_power_up() as well?
--
Mark Brown <broonie@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
2026-11-04 15:24 [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Richard Fitzgerald
2026-11-04 19:25 ` Mark Brown
@ 2026-11-04 19:26 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-11-04 19:26 UTC (permalink / raw)
To: Richard Fitzgerald; +Cc: linux-sound, linux-kernel, patches
On Wed, 04 Nov 2026 15:24:02 +0000, Richard Fitzgerald wrote:
> firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.4
Thanks!
[1/1] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path
https://git.kernel.org/broonie/sound/c/39d31f76ad1b
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 23:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 15:24 [PATCH] firmware: cs_dsp: Fix memory leak on cs_dsp_power_up() error path Richard Fitzgerald
2026-11-04 19:25 ` Mark Brown
2026-11-04 19:26 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®