[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a73d618f-2369-0d80-f8c6-22ddd9a9a716@samsung.com>
Date: Mon, 15 Mar 2021 18:54:52 +0900
From: Chanwoo Choi <cw00.choi@...sung.com>
To: Lukasz Luba <lukasz.luba@....com>, linux-kernel@...r.kernel.org,
linux-pm@...r.kernel.org
Cc: myungjoo.ham@...sung.com, kyungmin.park@...sung.com,
stable@...r.kernel.org
Subject: Re: [PATCH v2] PM / devfreq: Unlock mutex and free devfreq struct
in error path
On 3/15/21 6:31 PM, Lukasz Luba wrote:
> The devfreq->lock is held for time of setup. Release the lock in the
> error path, before jumping to the end of the function.
>
> Change the goto destination which frees the allocated memory.
>
> Cc: v5.9+ <stable@...r.kernel.org> # v5.9+
> Fixes: 4dc3bab8687f ("PM / devfreq: Add support delayed timer for polling mode")
> Signed-off-by: Lukasz Luba <lukasz.luba@....com>
> ---
> v2:
> - added fixes tag and CC stable v5.9+
> - used capital letter in commit header
>
>
> drivers/devfreq/devfreq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index b6d3e7db0b09..99b2eeedc238 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -822,7 +822,8 @@ struct devfreq *devfreq_add_device(struct device *dev,
>
> if (devfreq->profile->timer < 0
> || devfreq->profile->timer >= DEVFREQ_TIMER_NUM) {
> - goto err_out;
> + mutex_unlock(&devfreq->lock);
> + goto err_dev;
> }
>
> if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
>
Applied it. Thanks.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
Powered by blists - more mailing lists