Skip to content

Commit

Permalink
ASoC: mediatek: mt8183: 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-3-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 4934337 commit cb00600
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion sound/soc/mediatek/mt8183/mt8183-mt6358-ts3a227-max98357.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb00600

Please sign in to comment.