From: Shengjiu Wang Date: Tue, 13 Sep 2022 09:00:01 +0000 (+0800) Subject: ASoC: imx-card: Fix refcount issue with of_node_put X-Git-Tag: v5.15.73~62 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5664dc84fc2ea32d5890a77f0e77ddb7e442e2dc;p=platform%2Fkernel%2Flinux-rpi.git 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 Link: https://lore.kernel.org/r/1663059601-29259-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- diff --git a/sound/soc/fsl/imx-card.c b/sound/soc/fsl/imx-card.c index 593d69b..d59f5ef 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;