summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpi_pad.c
diff options
context:
space:
mode:
authorLenny Szubowicz <lszubowi@redhat.com>2018-03-27 15:56:40 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-03-30 12:04:58 +0200
commit8b29d29abc484d638213dd79a18a95ae7e5bb402 (patch)
tree32af5d675dc76c2294ad3172efd3969fd8d7de0d /drivers/acpi/acpi_pad.c
parentLinux 4.16-rc7 (diff)
downloadlinux-8b29d29abc484d638213dd79a18a95ae7e5bb402.tar.xz
linux-8b29d29abc484d638213dd79a18a95ae7e5bb402.zip
ACPI: acpi_pad: Fix memory leak in power saving threads
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: Lenny Szubowicz <lszubowi@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpi_pad.c')
-rw-r--r--drivers/acpi/acpi_pad.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/acpi_pad.c b/drivers/acpi/acpi_pad.c
index 754431031282..552c1f725b6c 100644
--- a/drivers/acpi/acpi_pad.c
+++ b/drivers/acpi/acpi_pad.c
@@ -110,6 +110,7 @@ static void round_robin_cpu(unsigned int tsk_index)
cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus);
if (cpumask_empty(tmp)) {
mutex_unlock(&round_robin_lock);
+ free_cpumask_var(tmp);
return;
}
for_each_cpu(cpu, tmp) {
@@ -127,6 +128,8 @@ static void round_robin_cpu(unsigned int tsk_index)
mutex_unlock(&round_robin_lock);
set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu));
+
+ free_cpumask_var(tmp);
}
static void exit_round_robin(unsigned int tsk_index)