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>
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;
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,
err_free_dai:
if (sec_dai)
i2s_free_sec_dai(sec_dai);
+err_disable_clk:
+ clk_disable_unprepare(pri_dai->clk);
return ret;
}