Patch "cpufreq: amd-pstate: fix memory leak on CPU EPP exit" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cpufreq: amd-pstate: fix memory leak on CPU EPP exit

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cpufreq-amd-pstate-fix-memory-leak-on-cpu-epp-exit.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 06bc74f02509d5d5afe93e4dba7da825c982039e
Author: Peng Ma <andypma@xxxxxxxxxxx>
Date:   Thu May 16 14:30:42 2024 +0800

    cpufreq: amd-pstate: fix memory leak on CPU EPP exit
    
    [ Upstream commit cea04f3d9aeebda9d9c063c0dfa71e739c322c81 ]
    
    The cpudata memory from kzalloc() in amd_pstate_epp_cpu_init() is
    not freed in the analogous exit function, so fix that.
    
    Signed-off-by: Peng Ma <andypma@xxxxxxxxxxx>
    Acked-by: Mario Limonciello <mario.limonciello@xxxxxxx>
    Reviewed-by: Perry Yuan <Perry.Yuan@xxxxxxx>
    [ rjw: Subject and changelog edits ]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index 6c989d859b396..6af175e6c08ac 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1462,6 +1462,13 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
 
 static int amd_pstate_epp_cpu_exit(struct cpufreq_policy *policy)
 {
+	struct amd_cpudata *cpudata = policy->driver_data;
+
+	if (cpudata) {
+		kfree(cpudata);
+		policy->driver_data = NULL;
+	}
+
 	pr_debug("CPU %d exiting\n", policy->cpu);
 	return 0;
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux