Skip to content

Commit

Permalink
ASoC: mediatek: mt8173: fix device_node leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tzung-Bi Shih authored and Mark Brown committed Dec 24, 2021
1 parent 2f15d3c commit 4934337
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/mediatek/mt8173/mt8173-max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/mediatek/mt8173/mt8173-rt5650-rt5514.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/mediatek/mt8173/mt8173-rt5650-rt5676.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 2 additions & 0 deletions sound/soc/mediatek/mt8173/mt8173-rt5650.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4934337

Please sign in to comment.