ASoC: mediatek: mt8173: fix device_node leak
authorTzung-Bi Shih <tzungbi@google.com>
Fri, 24 Dec 2021 06:47:16 +0000 (14:47 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 24 Dec 2021 14:06:52 +0000 (14:06 +0000)
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>
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 2408c9d..65941dd 100644 (file)
@@ -180,6 +180,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 e6e824f..227b0b7 100644 (file)
@@ -218,6 +218,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 ba6fe3d..8df2ff2 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 9b933cc..16ddf9f 100644 (file)
@@ -323,6 +323,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;
 }