ASoC: mediatek: mt8183: fix device_node leak

[ Upstream commit cb006006fe6221f092fadaffd3f219288304c9ad ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Tzung-Bi Shih 2021-12-24 14:47:17 +08:00 committed by Greg Kroah-Hartman
parent f28672eef4
commit ff08cf1e34
2 changed files with 11 additions and 2 deletions

View File

@ -787,7 +787,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

View File

@ -720,7 +720,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