ASoC: imx-card: Fix refcount issue with of_node_put
authorShengjiu Wang <shengjiu.wang@nxp.com>
Tue, 13 Sep 2022 09:00:01 +0000 (17:00 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Oct 2022 08:39:41 +0000 (10:39 +0200)
commit5664dc84fc2ea32d5890a77f0e77ddb7e442e2dc
tree1a8b9838ad737923e045ea94f000fe481cb6572e
parent367403bc1cfe953a560e7764c3f288b858bc707a
ASoC: imx-card: Fix refcount issue with of_node_put

[ Upstream commit d56ba9a04d7548d4149c46ec86a0e3cc41a70f4a ]

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>
Link: https://lore.kernel.org/r/1663059601-29259-1-git-send-email-shengjiu.wang@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/imx-card.c