mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Mario Limonciello (AMD) (kernel.org)" <superm1@kernel.org>
To: "Gautham R. Shenoy" <gautham.shenoy@amd.com>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	K Prateek Nayak <kprateek.nayak@amd.com>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init()
Date: Fri, 6 Mar 2026 20:29:20 -0600	[thread overview]
Message-ID: <30bff99d-f74a-47a4-aed5-2616a32fe423@kernel.org> (raw)
In-Reply-To: <20260306095753.17155-2-gautham.shenoy@amd.com>



On 3/6/2026 3:57 AM, Gautham R. Shenoy wrote:
> On failure to set the epp, the function amd_pstate_epp_cpu_init()
> returns with an error code without freeing the cpudata object that was
> allocated at the beginning of the function.
> 
> Ensure that the cpudata object is freed before returning from the
> function.
> 
> This memory leak was discovered by Claude Opus 4.6 with the aid of
> Chris Mason's AI review-prompts
> (https://github.com/masoncl/review-prompts/tree/main/kernel).
> 
> Assisted-by: Claude:claude-opus-4.6 review-prompts/linux
> Fixes: f9a378ff6443 ("cpufreq/amd-pstate: Set different default EPP policy for Epyc and Ryzen")
> Signed-off-by: Gautham R. Shenoy <gautham.shenoy@amd.com>
Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org>
> ---
>   drivers/cpufreq/amd-pstate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index 5aa9fcd80cf51..d57969c72c9dc 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1533,7 +1533,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>   
>   	ret = amd_pstate_set_epp(policy, cpudata->epp_default);
>   	if (ret)
> -		return ret;
> +		goto free_cpudata1;
>   
>   	current_pstate_driver->adjust_perf = NULL;
>   


  reply	other threads:[~2026-03-07  2:29 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-06  9:57 [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 1/9] amd-pstate: Fix memory leak in amd_pstate_epp_cpu_init() Gautham R. Shenoy
2026-03-07  2:29   ` Mario Limonciello (AMD) (kernel.org) [this message]
2026-03-06  9:57 ` [PATCH 2/9] amd-pstate: Update cppc_req_cached in fast_switch case Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 3/9] amd-pstate: Make certain freq_attrs conditionally visible Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 4/9] x86/cpufeatures: Add AMD CPPC Performance Priority feature Gautham R. Shenoy
2026-03-06 10:45   ` Borislav Petkov
2026-03-06  9:57 ` [PATCH 5/9] amd-pstate: Add support for CPPC_REQ2 and FLOOR_PERF Gautham R. Shenoy
2026-03-06 17:54   ` kernel test robot
2026-03-06 20:22   ` kernel test robot
2026-03-07  0:08   ` kernel test robot
2026-03-06  9:57 ` [PATCH 6/9] amd-pstate: Add sysfs support for floor_freq and floor_count Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 7/9] amd-pstate: Introduce a tracepoint trace_amd_pstate_cppc_req2() Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 8/9] Documentation/amd-pstate: List prefcore related sysfs files Gautham R. Shenoy
2026-03-06  9:57 ` [PATCH 9/9] Documentation/amd-pstate: Add documentation for amd_pstate_floor_{freq,count} Gautham R. Shenoy
2026-03-10  3:45   ` K Prateek Nayak
2026-03-11 10:32     ` Gautham R. Shenoy
2026-03-10  3:38 ` [PATCH 0/9] amd-pstate: Introduce AMD CPPC Performance Priority K Prateek Nayak

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=30bff99d-f74a-47a4-aed5-2616a32fe423@kernel.org \
    --to=superm1@kernel.org \
    --cc=gautham.shenoy@amd.com \
    --cc=kprateek.nayak@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /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®