Skip to content

Commit 6c29e29

Browse files
Dan Carpenterchanwoochoi
authored andcommitted
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/[email protected]/ Fixes: d280560 ("PM / devfreq: mediatek: protect oop in critical session") Signed-off-by: Dan Carpenter <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Chanwoo Choi <[email protected]>
1 parent e50fa1a commit 6c29e29

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/devfreq/mtk-cci-devfreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ static int mtk_ccifreq_target(struct device *dev, unsigned long *freq,
146146
opp = devfreq_recommended_opp(dev, &opp_rate, 1);
147147
if (IS_ERR(opp)) {
148148
dev_err(dev, "failed to find opp for freq: %ld\n", opp_rate);
149-
return PTR_ERR(opp);
149+
ret = PTR_ERR(opp);
150+
goto out_unlock;
150151
}
151152

152153
voltage = dev_pm_opp_get_voltage(opp);

0 commit comments

Comments
 (0)