* [PATCH] ASoC: imx-card: Fix refcount issue with of_node_put
@ 2022-09-13 9:00 Shengjiu Wang
2022-09-13 13:31 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Shengjiu Wang @ 2022-09-13 9:00 UTC (permalink / raw)
To: nicoleotsuka, Xiubo.Lee, festevam, shengjiu.wang, lgirdwood,
broonie, perex, tiwai, alsa-devel
Cc: linuxppc-dev, linux-kernel
imx_card_parse_of will search all the node with loop,
if there is defer probe happen in the middle of loop,
the previous released codec node will be released
twice, then cause refcount issue.
Here assign NULL to pointer of released nodes to fix
the issue.
Fixes: aa736700f42f ("ASoC: imx-card: Add imx-card machine driver")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
sound/soc/fsl/imx-card.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c
index 14be29530fb5..3f128ced4180 100644
--- a/sound/soc/fsl/imx-card.c
+++ b/sound/soc/fsl/imx-card.c
@@ -698,6 +698,10 @@ static int imx_card_parse_of(struct imx_card_data *data)
of_node_put(cpu);
of_node_put(codec);
of_node_put(platform);
+
+ cpu = NULL;
+ codec = NULL;
+ platform = NULL;
}
return 0;
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: imx-card: Fix refcount issue with of_node_put
2022-09-13 9:00 [PATCH] ASoC: imx-card: Fix refcount issue with of_node_put Shengjiu Wang
@ 2022-09-13 13:31 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2022-09-13 13:31 UTC (permalink / raw)
To: perex, Shengjiu Wang, alsa-devel, tiwai, Xiubo.Lee, lgirdwood,
nicoleotsuka, shengjiu.wang, festevam
Cc: linux-kernel, linuxppc-dev
On Tue, 13 Sep 2022 17:00:01 +0800, Shengjiu Wang wrote:
> imx_card_parse_of will search all the node with loop,
> if there is defer probe happen in the middle of loop,
> the previous released codec node will be released
> twice, then cause refcount issue.
>
> Here assign NULL to pointer of released nodes to fix
> the issue.
>
> [...]
Applied to
broonie/sound.git for-linus
Thanks!
[1/1] ASoC: imx-card: Fix refcount issue with of_node_put
commit: d56ba9a04d7548d4149c46ec86a0e3cc41a70f4a
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] 2+ messages in thread
end of thread, other threads:[~2022-09-13 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 9:00 [PATCH] ASoC: imx-card: Fix refcount issue with of_node_put Shengjiu Wang
2022-09-13 13:31 ` Mark Brown
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®