diff options
author | Viorel Suman <viorel.suman@nxp.com> | 2019-04-10 11:06:38 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-05-02 10:46:14 +0900 |
commit | 8bb678d75954e9e5b9ecabfe95b20f650fd91edb (patch) | |
tree | 26722edb683d202409efbda78d1b9da291e7aa73 /sound/soc/fsl | |
parent | a2be42f18d409213bb7e7a736e3ef6ba005115bb (diff) | |
download | linux-stable-8bb678d75954e9e5b9ecabfe95b20f650fd91edb.tar.gz linux-stable-8bb678d75954e9e5b9ecabfe95b20f650fd91edb.tar.bz2 linux-stable-8bb678d75954e9e5b9ecabfe95b20f650fd91edb.zip |
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: Viorel Suman <viorel.suman@nxp.com>
Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/imx-audmix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/fsl/imx-audmix.c b/sound/soc/fsl/imx-audmix.c index 7983bd339c01..9aaf3e5b45b9 100644 --- a/sound/soc/fsl/imx-audmix.c +++ b/sound/soc/fsl/imx-audmix.c @@ -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); |