summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2025-11-24 11:49:05 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-19 13:11:55 +0100
commit3847ea8a9b5cdfa7cc3240db9d004d35b9e36201 (patch)
tree3a879842b0829eedc4f576eb3c7c81c1e6e47c72 /sound
parent2dc65cf1a494f721670c3647899a00ae5a6db04e (diff)
ASoC: stm32: sai: fix device leak on probe
commit e26ff429eaf10c4ef1bc3dabd9bf27eb54b7e1f4 upstream. 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> Link: https://patch.msgid.link/20251124104908.15754-2-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/stm/stm32_sai.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/stm/stm32_sai.c b/sound/soc/stm/stm32_sai.c
index 058757c721f0..bf691cc3f5b2 100644
--- a/sound/soc/stm/stm32_sai.c
+++ b/sound/soc/stm/stm32_sai.c
@@ -127,6 +127,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");
@@ -143,7 +144,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;
}