Commit 6c29e29e authored by Dan Carpenter's avatar Dan Carpenter Committed by Chanwoo Choi

PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()

Call mutex_unlock(&drv->reg_lock) before returning the error code.

Link: https://lore.kernel.org/all/1bada9b2-d276-4123-bfdf-03d165569543@moroto.mountain/
Fixes: d2805601 ("PM / devfreq: mediatek: protect oop in critical session")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarChanwoo Choi <cw00.choi@samsung.com>
parent e50fa1a5
......@@ -146,7 +146,8 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq,
opp = devfreq_recommended_opp(dev, &opp_rate, 1);
if (IS_ERR(opp)) {
dev_err(dev, "failed to find opp for freq: %ld\n", opp_rate);
return PTR_ERR(opp);
ret = PTR_ERR(opp);
goto out_unlock;
}
voltage = dev_pm_opp_get_voltage(opp);
......
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