ASoC: mediatek: mt8173: fix device_node leak
authorTzung-Bi Shih <tzungbi@google.com>
Fri, 24 Dec 2021 06:47:16 +0000 (14:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jan 2022 07:47:40 +0000 (08:47 +0100)
[ Upstream commit 493433785df0075afc0c106ab65f10a605d0b35d ]

Fixes the device_node leak.

Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20211224064719.2031210-2-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/mediatek/mt8173/mt8173-max98090.c
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
sound/soc/mediatek/mt8173/mt8173-rt5650.c

index 5524a2c727ec76ad25af3a8386eda5f09678369e..cab30cb48366d422d060b4532e265f043ea4d3c0 100644 (file)
@@ -183,6 +183,9 @@ static int mt8173_max98090_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(codec_node);
+       of_node_put(platform_node);
        return ret;
 }
 
index 467f7049a28863fca5f3750fb27bf1ad9369e0c3..52fdd766ee82c03ab3db93ff67d69bfd0d0aed56 100644 (file)
@@ -228,6 +228,8 @@ static int mt8173_rt5650_rt5514_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;
 }
 
index 1b8b2a77884505515460a477309bb658312aed2a..5d75b04f074fe549b2237f2c6b2a0954ac323801 100644 (file)
@@ -285,6 +285,8 @@ static int mt8173_rt5650_rt5676_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;
 }
 
index ba65f4157a7e0ef6a60e5406e2570cfb1aaa14d9..d02a90201b13befec76a64a24952590d36fca981 100644 (file)
@@ -317,6 +317,8 @@ static int mt8173_rt5650_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;
 }