]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ASoC: stm32: sai: fix OF node leak on probe
authorJohan Hovold <johan@kernel.org>
Mon, 24 Nov 2025 10:49:07 +0000 (11:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2026 09:16:53 +0000 (10:16 +0100)
commit3752afcc6d80d5525e236e329895ba2cb93bcb26
tree0430aed7d0210355526b2fe9544d69c32c71a4a7
parent88636450c4add16f3a63149606aa75603ea5a981
ASoC: stm32: sai: fix OF node leak on probe

commit 23261f0de09427367e99f39f588e31e2856a690e upstream.

The reference taken to the sync provider OF node when probing the
platform device is currently only dropped if the set_sync() callback
fails during DAI probe.

Make sure to drop the reference on platform probe failures (e.g. probe
deferral) and on driver unbind.

This also avoids a potential use-after-free in case the DAI is ever
reprobed without first rebinding the platform driver.

Fixes: 5914d285f6b7 ("ASoC: stm32: sai: Add synchronization support")
Fixes: d4180b4c02e7 ("ASoC: stm32: sai: fix set_sync service")
Cc: Olivier Moysan <olivier.moysan@st.com>
Cc: stable@vger.kernel.org # 4.16: d4180b4c02e7
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: olivier moysan <olivier.moysan@foss.st.com>
Link: https://patch.msgid.link/20251124104908.15754-4-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
sound/soc/stm/stm32_sai.c
sound/soc/stm/stm32_sai_sub.c