diff options
author | Lenny Szubowicz <lszubowi@redhat.com> | 2018-03-27 09:56:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2018-03-30 06:04:58 -0400 |
commit | 8b29d29abc484d638213dd79a18a95ae7e5bb402 (patch) | |
tree | 32af5d675dc76c2294ad3172efd3969fd8d7de0d | |
parent | 3eb2ce825ea1ad89d20f7a3b5780df850e4be274 (diff) |
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>
-rw-r--r-- | drivers/acpi/acpi_pad.c | 3 |
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) | |||
110 | cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); | 110 | cpumask_andnot(tmp, cpu_online_mask, pad_busy_cpus); |
111 | if (cpumask_empty(tmp)) { | 111 | if (cpumask_empty(tmp)) { |
112 | mutex_unlock(&round_robin_lock); | 112 | mutex_unlock(&round_robin_lock); |
113 | free_cpumask_var(tmp); | ||
113 | return; | 114 | return; |
114 | } | 115 | } |
115 | for_each_cpu(cpu, tmp) { | 116 | for_each_cpu(cpu, tmp) { |
@@ -127,6 +128,8 @@ static void round_robin_cpu(unsigned int tsk_index) | |||
127 | mutex_unlock(&round_robin_lock); | 128 | mutex_unlock(&round_robin_lock); |
128 | 129 | ||
129 | set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); | 130 | set_cpus_allowed_ptr(current, cpumask_of(preferred_cpu)); |
131 | |||
132 | free_cpumask_var(tmp); | ||
130 | } | 133 | } |
131 | 134 | ||
132 | static void exit_round_robin(unsigned int tsk_index) | 135 | static void exit_round_robin(unsigned int tsk_index) |