From: Olivier MOYSAN <olivier.moysan@foss.st.com>
To: Johan Hovold <johan@kernel.org>,
Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>,
Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
<linux-sound@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<stable@vger.kernel.org>, olivier moysan <olivier.moysan@st.com>,
Wen Yang <yellowriver2010@hotmail.com>
Subject: Re: [PATCH 1/4] ASoC: stm32: sai: fix device leak on probe
Date: Tue, 25 Nov 2025 14:36:27 +0100 [thread overview]
Message-ID: <c98f02a1-0153-496d-a484-0bac7acd030a@foss.st.com> (raw)
In-Reply-To: <20251124104908.15754-2-johan@kernel.org>
Hi Johan,
Thanks for your fixes.
On 11/24/25 11:49, Johan Hovold wrote:
> Make sure to drop the reference taken when looking up the sync provider
> device and its driver data during DAI probe on probe failures and on
> unbind.
>
> Note that holding a reference to a device does not prevent its driver
> data from going away so there is no point in keeping the reference.
>
> Fixes: 7dd0d835582f ("ASoC: stm32: sai: simplify sync modes management")
> Fixes: 1c3816a19487 ("ASoC: stm32: sai: add missing put_device()")
> Cc: stable@vger.kernel.org # 4.16: 1c3816a19487
> Cc: olivier moysan <olivier.moysan@st.com>
> Cc: Wen Yang <yellowriver2010@hotmail.com>
> Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: olivier moysan <olivier.moysan@foss.st.com>
> ---
> sound/soc/stm/stm32_sai.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
> index fa821e3fb427..7065aeb0e524 100644
> --- a/sound/soc/stm/stm32_sai.c
> +++ b/sound/soc/stm/stm32_sai.c
> @@ -143,6 +143,7 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
> }
>
> sai_provider = platform_get_drvdata(pdev);
> + put_device(&pdev->dev);
> if (!sai_provider) {
> dev_err(&sai_client->pdev->dev,
> "SAI sync provider data not found\n");
> @@ -159,7 +160,6 @@ static int stm32_sai_set_sync(struct stm32_sai_data *sai_client,
> ret = stm32_sai_sync_conf_provider(sai_provider, synco);
>
> error:
> - put_device(&pdev->dev);
> of_node_put(np_provider);
> return ret;
> }
next prev parent reply other threads:[~2025-11-25 13:37 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 10:49 [PATCH 0/4] ASoC: stm32: sai: fix device and OF node leaks " Johan Hovold
2025-11-24 10:49 ` [PATCH 1/4] ASoC: stm32: sai: fix device leak " Johan Hovold
2025-11-25 13:36 ` Olivier MOYSAN [this message]
2025-11-24 10:49 ` [PATCH 2/4] ASoC: stm32: sai: fix clk prepare imbalance on probe failure Johan Hovold
2025-11-25 13:36 ` Olivier MOYSAN
2025-11-24 10:49 ` [PATCH 3/4] ASoC: stm32: sai: fix OF node leak on probe Johan Hovold
2025-11-25 13:37 ` Olivier MOYSAN
2025-11-24 10:49 ` [PATCH 4/4] ASoC: stm32: sai: clean up probe error path Johan Hovold
2025-11-25 13:37 ` Olivier MOYSAN
2025-11-25 19:22 ` [PATCH 0/4] ASoC: stm32: sai: fix device and OF node leaks on probe Mark Brown
2025-11-26 21:00 ` Gabor Juhos
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=c98f02a1-0153-496d-a484-0bac7acd030a@foss.st.com \
--to=olivier.moysan@foss.st.com \
--cc=alexandre.torgue@foss.st.com \
--cc=arnaud.pouliquen@foss.st.com \
--cc=broonie@kernel.org \
--cc=johan@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=mcoquelin.stm32@gmail.com \
--cc=olivier.moysan@st.com \
--cc=perex@perex.cz \
--cc=stable@vger.kernel.org \
--cc=tiwai@suse.com \
--cc=yellowriver2010@hotmail.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 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®