Re: [PATCH] cpufreq: powernow-k8: Fix possible memory leak in powernowk8_cpu_init()
"Rafael J. Wysocki (Intel)" <[email protected]>
| Newsgroups | org.kernel.vger.linux-pm,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <CAJZ5v0ijun5UYQs1r+bTK_x6BgTCUbzvdGCxncW9Wc=K400gkw@mail.gmail.com> |
On Mon, Jul 27, 2026 at 12:39 PM Zhongqiu Han <[email protected]> wrote: > > On 7/27/2026 6:20 PM, Viresh Kumar wrote: > > On 27-07-26, 15:05, Abdun Nihaal wrote: > >> The memory allocated for data->powernow_table inside > >> powernow_k8_cpu_init_acpi() or find_psb_table() is not freed in one of > >> the error paths in powernowk8_cpu_init(). Fix that by adding a kfree(). > >> > >> Fixes: 1ff6e97f1d99 ("[CPUFREQ] cpumask: avoid playing with cpus_allowed in powernow-k8.c") > >> Cc: [email protected] > >> Signed-off-by: Abdun Nihaal <[email protected]> > >> --- > >> Compile tested only. Issue found using static analysis. > >> > >> drivers/cpufreq/powernow-k8.c | 1 + > >> 1 file changed, 1 insertion(+) > >> > >> diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c > >> index fe1f499b4fc0..c9bcc6f0ab7b 100644 > >> --- a/drivers/cpufreq/powernow-k8.c > >> +++ b/drivers/cpufreq/powernow-k8.c > >> @@ -1085,6 +1085,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) > >> > >> err_out_exit_acpi: > >> powernow_k8_cpu_exit_acpi(data); > >> + kfree(data->powernow_table); > >> > >> err_out: > >> kfree(data); > > > > Acked-by: Viresh Kumar <[email protected]> > > > > Reviewed-by: Zhongqiu Han <[email protected]> Applied as 7.2-rc material, thanks!