Commit 8bb678d7 authored by Viorel Suman's avatar Viorel Suman Committed by Mark Brown

ASoC: imx-audmix: fix object reference leaks in probe

Release the reference to the underlying device taken
by of_find_device_by_node() call.
Signed-off-by: default avatarViorel Suman <viorel.suman@nxp.com>
Reported-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a2be42f1
......@@ -171,6 +171,7 @@ static int imx_audmix_probe(struct platform_device *pdev)
np->full_name);
return -EINVAL;
}
put_device(&audmix_pdev->dev);
num_dai = of_count_phandle_with_args(audmix_np, "dais", NULL);
if (num_dai != FSL_AUDMIX_MAX_DAIS) {
......@@ -216,6 +217,7 @@ static int imx_audmix_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to find SAI platform device\n");
return -EINVAL;
}
put_device(&cpu_pdev->dev);
dai_name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%s%s",
fe_name_pref, args.np->full_name + 1);
......@@ -280,6 +282,8 @@ static int imx_audmix_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "failed to find SAI platform device\n");
return -EINVAL;
}
put_device(&cpu_pdev->dev);
priv->cpu_mclk = devm_clk_get(&cpu_pdev->dev, "mclk1");
if (IS_ERR(priv->cpu_mclk)) {
ret = PTR_ERR(priv->cpu_mclk);
......
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