summary refs log tree commit diff
path: root/sound
diff options
context:
space:
mode:
authorBixuan Cui <cuibixuan@huawei.com>2021-09-11 16:12:46 +0800
committerMark Brown <broonie@kernel.org>2021-09-15 13:12:26 +0100
commitb2fc2c92d2fd34d93268f677e514936f50dd6b5c (patch)
tree6816ded55671c30e8362c47a76912a4c57475d60 /sound
parent1e5dd2b9d63f8b6d1ccb8f0ca97f5daf5e2d720c (diff)
downloadlinux-b2fc2c92d2fd34d93268f677e514936f50dd6b5c.tar.gz
ASoC: mediatek: mt8195: Add missing of_node_put()
The platform_node is returned by of_parse_phandle() should have
of_node_put() before return.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Bixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210911081246.33867-1-cuibixuan@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c b/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
index c97ace7387b4..8cd8450409e8 100644
--- a/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
+++ b/sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
@@ -1041,8 +1041,10 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev)
 	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-	if (!priv)
+	if (!priv) {
+		of_node_put(platform_node);
 		return -ENOMEM;
+	}
 
 	snd_soc_card_set_drvdata(card, priv);
 
@@ -1050,6 +1052,8 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev)
 	if (ret)
 		dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
 			__func__, ret);
+
+	of_node_put(platform_node);
 	return ret;
 }