Commit fc2de796 authored by Lenny Szubowicz's avatar Lenny Szubowicz Committed by Greg Kroah-Hartman

ACPI: acpi_pad: Fix memory leak in power saving threads

[ Upstream commit 8b29d29a ]

Fix once per second (round_robin_time) memory leak of about 1 KB in
each acpi_pad kernel idling thread that is activated.

Found by testing with kmemleak.
Signed-off-by: default avatarLenny Szubowicz <lszubowi@redhat.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d023498f
...@@ -110,6 +110,7 @@ static void round_robin_cpu(unsigned int tsk_index) ...@@ -110,6 +110,7 @@ static void round_robin_cpu(unsigned int tsk_index)
cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus);
if (cpumask_empty(tmp)) { if (cpumask_empty(tmp)) {
mutex_unlock(&round_robin_lock); mutex_unlock(&round_robin_lock);
free_cpumask_var(tmp);
return; return;
} }
for_each_cpu(cpu, tmp) { for_each_cpu(cpu, tmp) {
...@@ -127,6 +128,8 @@ static void round_robin_cpu(unsigned int tsk_index) ...@@ -127,6 +128,8 @@ static void round_robin_cpu(unsigned int tsk_index)
mutex_unlock(&round_robin_lock); mutex_unlock(&round_robin_lock);
set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu));
free_cpumask_var(tmp);
} }
static void exit_round_robin(unsigned int tsk_index) static void exit_round_robin(unsigned int tsk_index)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment