[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220510081232.4u25qgryszzqblho@vireshk-i7>
Date: Tue, 10 May 2022 13:42:32 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Wan Jiabing <wanjiabing@...o.com>
Cc: "Rafael J. Wysocki" <rafael@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Rex-BC Chen <rex-bc.chen@...iatek.com>,
"Andrew-sh.Cheng" <andrew-sh.cheng@...iatek.com>,
Jia-Wei Chang <jia-wei.chang@...iatek.com>,
linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH] cpufreq: mediatek: Fix potential deadlock problem in
mtk_cpufreq_set_target
On 10-05-22, 16:01, Wan Jiabing wrote:
> Fix following coccichek error:
> ./drivers/cpufreq/mediatek-cpufreq.c:199:2-8: preceding lock on line
> ./drivers/cpufreq/mediatek-cpufreq.c:208:2-8: preceding lock on line
>
> mutex_lock is acquired but not released before return.
> Use 'goto out' to help releasing the mutex_lock.
>
> Fixes: c210063b40ac ("cupful: mediatek: Add opp notification support")
cupful ??
> Signed-off-by: Wan Jiabing <wanjiabing@...o.com>
> ---
> drivers/cpufreq/mediatek-cpufreq.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c
> index 75bf21ddf61f..4c6d53c99d79 100644
> --- a/drivers/cpufreq/mediatek-cpufreq.c
> +++ b/drivers/cpufreq/mediatek-cpufreq.c
> @@ -196,7 +196,8 @@ static int mtk_cpufreq_set_target(struct cpufreq_policy *policy,
>
> if (pre_vproc < 0) {
> dev_err(cpu_dev, "invalid Vproc value: %d\n", pre_vproc);
> - return pre_vproc;
> + ret = pre_vproc;
> + goto out;
> }
>
> freq_hz = freq_table[index].frequency * 1000;
> @@ -205,7 +206,8 @@ static int mtk_cpufreq_set_target(struct cpufreq_policy *policy,
> if (IS_ERR(opp)) {
> dev_err(cpu_dev, "cpu%d: failed to find OPP for %ld\n",
> policy->cpu, freq_hz);
> - return PTR_ERR(opp);
> + ret = PTR_ERR(opp);
> + goto out;
> }
> vproc = dev_pm_opp_get_voltage(opp);
> dev_pm_opp_put(opp);
> --
> 2.35.1
--
viresh
Powered by blists - more mailing lists