* [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling
@ 2025-12-19 14:24 Johan Hovold
2025-12-20 18:58 ` Dmitry Baryshkov
2025-12-22 22:12 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Johan Hovold @ 2025-12-19 14:24 UTC (permalink / raw)
To: Srinivas Kandagatla, Mark Brown
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel,
Johan Hovold, Ma Ke
A recent change fixed a couple of device leaks on component bind failure
and on unbind but did so in a confusing way by adding misleading
initialisations at bind() and bogus NULL checks at unbind().
Cc: Ma Ke <make24@iscas.ac.cn>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
sound/soc/codecs/pm4125.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/sound/soc/codecs/pm4125.c b/sound/soc/codecs/pm4125.c
index 8bc3b9994019..43dcafff6c77 100644
--- a/sound/soc/codecs/pm4125.c
+++ b/sound/soc/codecs/pm4125.c
@@ -1505,10 +1505,6 @@ static int pm4125_bind(struct device *dev)
struct device_link *devlink;
int ret;
- /* Initialize device pointers to NULL for safe cleanup */
- pm4125->rxdev = NULL;
- pm4125->txdev = NULL;
-
/* Give the soundwire subdevices some more time to settle */
usleep_range(15000, 15010);
@@ -1624,11 +1620,8 @@ static void pm4125_unbind(struct device *dev)
device_link_remove(dev, pm4125->rxdev);
device_link_remove(pm4125->rxdev, pm4125->txdev);
- /* Release device references acquired in bind */
- if (pm4125->txdev)
- put_device(pm4125->txdev);
- if (pm4125->rxdev)
- put_device(pm4125->rxdev);
+ put_device(pm4125->txdev);
+ put_device(pm4125->rxdev);
component_unbind_all(dev, pm4125);
}
--
2.51.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling
2025-12-19 14:24 [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling Johan Hovold
@ 2025-12-20 18:58 ` Dmitry Baryshkov
2025-12-22 22:12 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Baryshkov @ 2025-12-20 18:58 UTC (permalink / raw)
To: Johan Hovold
Cc: Srinivas Kandagatla, Mark Brown, Liam Girdwood, linux-sound,
linux-arm-msm, linux-kernel, Ma Ke
On Fri, Dec 19, 2025 at 03:24:12PM +0100, Johan Hovold wrote:
> A recent change fixed a couple of device leaks on component bind failure
> and on unbind but did so in a confusing way by adding misleading
> initialisations at bind() and bogus NULL checks at unbind().
>
> Cc: Ma Ke <make24@iscas.ac.cn>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> sound/soc/codecs/pm4125.c | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling
2025-12-19 14:24 [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling Johan Hovold
2025-12-20 18:58 ` Dmitry Baryshkov
@ 2025-12-22 22:12 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-12-22 22:12 UTC (permalink / raw)
To: Srinivas Kandagatla, Johan Hovold
Cc: Liam Girdwood, linux-sound, linux-arm-msm, linux-kernel, Ma Ke
On Fri, 19 Dec 2025 15:24:12 +0100, Johan Hovold wrote:
> A recent change fixed a couple of device leaks on component bind failure
> and on unbind but did so in a confusing way by adding misleading
> initialisations at bind() and bogus NULL checks at unbind().
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: codecs: pm4125: clean up bind() device reference handling
commit: 97af54473f2a79f663bd14d7c75e97d04bd0e283
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:[~2025-12-22 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-19 14:24 [PATCH] ASoC: codecs: pm4125: clean up bind() device reference handling Johan Hovold
2025-12-20 18:58 ` Dmitry Baryshkov
2025-12-22 22:12 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox