Skip to content

Commit

Permalink
ACPI: acpi_pad: Fix memory leak in power saving threads
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lenny Szubowicz authored and Rafael J. Wysocki committed Mar 30, 2018
1 parent 3eb2ce8 commit 8b29d29
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/acpi_pad.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit 8b29d29

Please sign in to comment.