* [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()
@ 2023-10-12 9:41 Dan Carpenter
2023-10-12 9:59 ` AngeloGioacchino Del Regno
2023-10-17 8:43 ` Chanwoo Choi
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2023-10-12 9:41 UTC (permalink / raw)
To: Mark Tseng
Cc: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Matthias Brugger,
AngeloGioacchino Del Regno, linux-pm, linux-mediatek,
kernel-janitors
Call mutex_unlock(&drv->reg_lock) before returning the error code.
Fixes: d2805601988f ("PM / devfreq: mediatek: protect oop in critical session")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
drivers/devfreq/mtk-cci-devfreq.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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);
--
2.39.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()
2023-10-12 9:41 [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() Dan Carpenter
@ 2023-10-12 9:59 ` AngeloGioacchino Del Regno
2023-10-17 8:43 ` Chanwoo Choi
1 sibling, 0 replies; 3+ messages in thread
From: AngeloGioacchino Del Regno @ 2023-10-12 9:59 UTC (permalink / raw)
To: Dan Carpenter, Mark Tseng
Cc: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Matthias Brugger,
linux-pm, linux-mediatek, kernel-janitors
Il 12/10/23 11:41, Dan Carpenter ha scritto:
> Call mutex_unlock(&drv->reg_lock) before returning the error code.
>
> 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>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target()
2023-10-12 9:41 [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() Dan Carpenter
2023-10-12 9:59 ` AngeloGioacchino Del Regno
@ 2023-10-17 8:43 ` Chanwoo Choi
1 sibling, 0 replies; 3+ messages in thread
From: Chanwoo Choi @ 2023-10-17 8:43 UTC (permalink / raw)
To: Dan Carpenter, Mark Tseng
Cc: MyungJoo Ham, Kyungmin Park, Chanwoo Choi, Matthias Brugger,
AngeloGioacchino Del Regno, linux-pm, linux-mediatek,
kernel-janitors
On 23. 10. 12. 18:41, Dan Carpenter wrote:
> Call mutex_unlock(&drv->reg_lock) before returning the error code.
>
> Fixes: d2805601988f ("PM / devfreq: mediatek: protect oop in critical session")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/devfreq/mtk-cci-devfreq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> 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);
Applied it. Thanks.
--
Best Regards,
Samsung Electronics
Chanwoo Choi
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-17 8:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-12 9:41 [PATCH] PM / devfreq: mediatek: unlock on error in mtk_ccifreq_target() Dan Carpenter
2023-10-12 9:59 ` AngeloGioacchino Del Regno
2023-10-17 8:43 ` Chanwoo Choi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.