Commit b2fc2c92 authored by Bixuan Cui's avatar Bixuan Cui Committed by Mark Brown

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: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarBixuan Cui <cuibixuan@huawei.com>
Link: https://lore.kernel.org/r/20210911081246.33867-1-cuibixuan@huawei.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1e5dd2b9
...@@ -1041,8 +1041,10 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev) ...@@ -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); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv) {
of_node_put(platform_node);
return -ENOMEM; return -ENOMEM;
}
snd_soc_card_set_drvdata(card, priv); snd_soc_card_set_drvdata(card, priv);
...@@ -1050,6 +1052,8 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev) ...@@ -1050,6 +1052,8 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev)
if (ret) if (ret)
dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n", dev_err(&pdev->dev, "%s snd_soc_register_card fail %d\n",
__func__, ret); __func__, ret);
of_node_put(platform_node);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment