From: Chanwoo Choi <cw00.choi@samsung.com>
To: Lukasz Luba <lukasz.luba@arm.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com
Subject: Re: [PATCH] PM / devfreq: unlock mutex and free devfreq struct in error path
Date: Mon, 15 Mar 2021 16:20:05 +0900 [thread overview]
Message-ID: <aa65398e-6de6-92df-3c27-a8a7f43eda10@samsung.com> (raw)
In-Reply-To: <20210312184534.6423-1-lukasz.luba@arm.com>
Hi Lukasz,
On 3/13/21 3:45 AM, 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.
>
> Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
> ---
> 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) {
>
Looks good to me. But, need to add the following information
and please use capital letter of the first character of patch title. Thanks.
Fixes: 4dc3bab8687f ("PM / devfreq: Add support delayed timer for polling mode")
Also, need to send it to stable lkml.
--
Best Regards,
Chanwoo Choi
Samsung Electronics
next prev parent reply other threads:[~2021-03-15 7:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210312184551epcas1p2fe579b2a736cac2814b8a236869c4c27@epcas1p2.samsung.com>
2021-03-12 18:45 ` Lukasz Luba
2021-03-15 7:20 ` Chanwoo Choi [this message]
2021-03-15 9:22 ` Lukasz Luba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa65398e-6de6-92df-3c27-a8a7f43eda10@samsung.com \
--to=cw00.choi@samsung.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=myungjoo.ham@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®