]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: mediatek: mt8183: fix device_node leak
authorTzung-Bi Shih <tzungbi@google.com>
Fri, 24 Dec 2021 06:47:17 +0000 (14:47 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 24 Dec 2021 14:06:53 +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-3-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c

index f8a72a5102ad5353609a23db52e4a7c5f462b253..ca893feab7ebff0eca71ec77c4f761e7fd844f2f 100644 (file)
@@ -781,7 +781,11 @@ static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev)
                return ret;
        }
 
-       return devm_snd_soc_register_card(&pdev->dev, card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
+
+       of_node_put(platform_node);
+       of_node_put(hdmi_codec);
+       return ret;
 }
 
 #ifdef CONFIG_OF
index d5fc86132b495e8c625d5dd5087b2d928f9dc7ed..19f8aead775dee3262c5142693aa5341dd4cf6f7 100644 (file)
@@ -780,7 +780,12 @@ mt8183_mt6358_ts3a227_max98357_dev_probe(struct platform_device *pdev)
                                 __func__, ret);
        }
 
-       return devm_snd_soc_register_card(&pdev->dev, card);
+       ret = devm_snd_soc_register_card(&pdev->dev, card);
+
+       of_node_put(platform_node);
+       of_node_put(ec_codec);
+       of_node_put(hdmi_codec);
+       return ret;
 }
 
 #ifdef CONFIG_OF