From: sashiko-bot@kernel.org
To: phucduc.bui@gmail.com
Cc: imx@lists.linux.dev, Frank.Li@kernel.org,
wsa+renesas@sang-engineering.com
Subject: Re: [PATCH v2 04/25] ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback
Date: Fri, 16 Oct 2026 04:14:59 +0000 [thread overview]
Message-ID: <sashiko-outbox-173752@kernel.org> (raw)
In-Reply-To: <20261015014324.5569-5-phucduc.bui@gmail.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] sound: memory leak of runtime->private_data in acp3x_dma_close()
--
commit f9bf5629ed83739ae2130cf6fe20e488a93aca99
Author: bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: raven: Fix acp3x_dma_close() being skipped on rollback
The commit ensures that acp3x_dma_open() explicitly returns 0 on success.
This prevents ASoC from skipping the .close() callback during rollback when
snd_pcm_hw_constraint_integer() returns 1.
> diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
> index 37ea5c572eb94..7650574990210 100644
> --- a/sound/soc/amd/raven/acp3x-pcm-dma.c
> +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
> @@ -237,7 +237,13 @@ static int acp3x_dma_open(struct snd_soc_component *component,
>
> i2s_data->acp3x_base = adata->acp3x_base;
> runtime->private_data = i2s_data;
> - return ret;
> +
> + /*
> + * ASoC only marks the component as opened when .open() returns 0.
> + * Since snd_pcm_hw_constraint_integer() may return 1, explicitly
> + * return 0 to ensure .close() is not skipped on rollback.
> + */
> + return 0;
[Severity: High]
Does this code leak the i2s_data structure stored in runtime->private_data?
While this patch ensures that acp3x_dma_close() is not skipped on rollback,
acp3x_dma_close() does not appear to free the memory allocated in
acp3x_dma_open():
sound/soc/amd/raven/acp3x-pcm-dma.c:acp3x_dma_close() {
...
ins = substream->runtime->private_data;
if (!ins)
return -EINVAL;
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
...
}
return 0;
}
Since there is no kfree(ins) in acp3x_dma_close(), repeatedly opening and
closing the stream could cause a memory leak.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261015014324.5569-1-phucduc.bui@gmail.com?part=4
next prev parent reply other threads:[~2026-10-16 4:14 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 1:42 [PATCH v2 00/25] ASoC: Fix constraint return value handling phucduc.bui
2026-10-15 1:42 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 01/25] ASoC: amd: acp: Fix .close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:19 ` sashiko-bot
2026-10-16 7:40 ` Bui Duc Phuc
2026-10-15 1:43 ` [PATCH v2 02/25] ASoC: amd: ps: Fix acp63_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 03/25] ASoC: amd: ps: Fix acp63_sdw_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 04/25] ASoC: amd: raven: Fix acp3x_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:14 ` sashiko-bot [this message]
2026-10-15 1:43 ` [PATCH v2 05/25] ASoC: amd: renoir: Fix acp_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 06/25] ASoC: amd: vangogh: Fix acp5x_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 07/25] ASoC: amd: yc: Fix acp6x_pdm_dma_close() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 08/25] ASoC: apple: mca: Ensure the DAI is marked as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 09/25] ASoC: atmel: atmel-pcm-pdc: Fix atmel_pcm_close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:16 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 10/25] ASoC: codecs: cs42l42: Ensure the DAI is marked as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 11/25] ASoC: codecs: nau8325: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 12/25] ASoC: codecs: nau8540: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 13/25] ASoC: codecs: nau8821: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 14/25] ASoC: codecs: nau8824: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 15/25] ASoC: codecs: nau8825: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 16/25] ASoC: codecs: wm8580: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 17/25] ASoC: codecs: wm8782: " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 18/25] ASoC: imx-pcm-rpmsg: Fix imx_rpmsg_pcm_close() being skipped on rollback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-16 4:14 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 19/25] ASoC: intel: atom: Fix .shutdown() " phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 10:44 ` Cezary Rojewski
2026-10-15 10:44 ` Cezary Rojewski
2026-10-16 4:12 ` sashiko-bot
2026-10-15 1:43 ` [PATCH v2 20/25] ASoC: renesas: fsi: Ensure the component is marked as opened on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 3:55 ` Kuninori Morimoto
2026-10-15 3:55 ` Kuninori Morimoto
2026-10-15 1:43 ` [PATCH v2 21/25] ASoC: renesas: msiof: Remove redundant period constraint phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 3:56 ` Kuninori Morimoto
2026-10-15 3:56 ` Kuninori Morimoto
2026-10-15 1:43 ` [PATCH v2 22/25] ASoC: renesas: rz-ssi: Ensure the component is marked as opened on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 23/25] ASoC: renesas: rz-ssi: Remove redundant component open callback phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 1:43 ` [PATCH v2 24/25] ASoC: rockchip: rk3399_gru_sound: Mark the link as started on success phucduc.bui
2026-10-15 1:43 ` phucduc.bui
2026-10-15 11:12 ` [PATCH v2 00/25] ASoC: Fix constraint return value handling Mark Brown
2026-10-15 11:12 ` Mark Brown
2026-10-16 1:52 ` Bui Duc Phuc
2026-10-16 1:52 ` Bui Duc Phuc
2026-10-16 4:00 ` [PATCH v2 25/25] ASoC: rockchip: rockchip_max98090: Mark the link as started on success phucduc.bui
2026-10-16 4:00 ` phucduc.bui
2026-10-16 10:27 ` Mark Brown
2026-10-16 10:27 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-173752@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=Frank.Li@kernel.org \
--cc=imx@lists.linux.dev \
--cc=phucduc.bui@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=wsa+renesas@sang-engineering.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.