diff options
author | Dan Carpenter <dan.carpenter@linaro.org> | 2023-10-12 12:41:12 +0300 |
---|---|---|
committer | Chanwoo Choi <cw00.choi@samsung.com> | 2023-10-17 17:54:01 +0900 |
commit | 6c29e29e4d7f29348a9e051ad5bdb833c5a1bbb6 (patch) | |
tree | b76bd949a5eff0637c08c30c39418d80ab64e32d /drivers/devfreq | |
parent | e50fa1a5ac52e2a2ec09b8028bdb1c4bf9166cbc (diff) |
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: d2805601988f ("PM / devfreq: mediatek: protect oop in critical session")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/mtk-cci-devfreq.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/devfreq/mtk-cci-devfreq.c b/drivers/devfreq/mtk-cci-devfreq.c index b0ed25e33f2b..11bc3d03494c 100644 --- a/drivers/devfreq/mtk-cci-devfreq.c +++ b/drivers/devfreq/mtk-cci-devfreq.c @@ -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); |