ASoC: samsung: i2s: Add missing clk_disable_unprepare() on error in samsung_i2s_probe()
authorWei Yongjun <weiyj.lk@gmail.com>
Tue, 23 Aug 2016 15:16:42 +0000 (15:16 +0000)
committerMark Brown <broonie@kernel.org>
Wed, 24 Aug 2016 11:38:02 +0000 (12:38 +0100)
Add the missing clk_disable_unprepare() before return
from samsung_i2s_probe() in the error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/i2s.c

index fa3ff03d97d56082a6614cc8dfb52bd816416c1b..7e32cf4581f8a853a2e53bf49cbb84e1bd11f0b8 100644 (file)
@@ -1318,7 +1318,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
                sec_dai = i2s_alloc_dai(pdev, true);
                if (!sec_dai) {
                        dev_err(&pdev->dev, "Unable to alloc I2S_sec\n");
-                       return -ENOMEM;
+                       ret = -ENOMEM;
+                       goto err_disable_clk;
                }
 
                sec_dai->lock = &pri_dai->spinlock;
@@ -1342,7 +1343,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 
        if (i2s_pdata && i2s_pdata->cfg_gpio && i2s_pdata->cfg_gpio(pdev)) {
                dev_err(&pdev->dev, "Unable to configure gpio\n");
-               return -EINVAL;
+               ret = -EINVAL;
+               goto err_disable_clk;
        }
 
        ret = devm_snd_soc_register_component(&pri_dai->pdev->dev,
@@ -1366,6 +1368,8 @@ static int samsung_i2s_probe(struct platform_device *pdev)
 err_free_dai:
        if (sec_dai)
                i2s_free_sec_dai(sec_dai);
+err_disable_clk:
+       clk_disable_unprepare(pri_dai->clk);
        return ret;
 }
 
This page took 0.030552 seconds and 5 git commands to generate.