Commit 64b1cbaa authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'pm+acpi-for-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm

Pull power management and ACPI fixes from Rafael J Wysocki:

 - Fix for a memory leak in acpi_bind_one() from Jesper Juhl.

 - Fix for an error code path memory leak in pm_genpd_attach_cpuidle()
   from Jonghwan Choi.

 - Fix for smp_processor_id() usage in preemptible code in powernow-k8
   from Andreas Herrmann.

 - Fix for a suspend-related memory leak in cpufreq stats from Xiaobing
   Tu.

 - Freezer fix for failure to clear PF_NOFREEZE along with PF_KTHREAD in
   flush_old_exec() from Oleg Nesterov.

 - acpi_processor_notify() fix from Alan Cox.

* tag 'pm+acpi-for-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
  ACPI: missing break
  freezer: exec should clear PF_NOFREEZE along with PF_KTHREAD
  Fix memory leak in cpufreq stats.
  cpufreq / powernow-k8: Remove usage of smp_processor_id() in preemptible code
  PM / Domains: Fix memory leak on error path in pm_genpd_attach_cpuidle
  ACPI: Fix memory leak in acpi_bind_one()
parents f54c77dd 879dca01
...@@ -159,6 +159,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle) ...@@ -159,6 +159,7 @@ static int acpi_bind_one(struct device *dev, acpi_handle handle)
if (physical_node->node_id >= ACPI_MAX_PHYSICAL_NODE) { if (physical_node->node_id >= ACPI_MAX_PHYSICAL_NODE) {
retval = -ENOSPC; retval = -ENOSPC;
mutex_unlock(&acpi_dev->physical_node_lock); mutex_unlock(&acpi_dev->physical_node_lock);
kfree(physical_node);
goto err; goto err;
} }
......
...@@ -409,6 +409,7 @@ static void acpi_processor_notify(struct acpi_device *device, u32 event) ...@@ -409,6 +409,7 @@ static void acpi_processor_notify(struct acpi_device *device, u32 event)
acpi_bus_generate_proc_event(device, event, 0); acpi_bus_generate_proc_event(device, event, 0);
acpi_bus_generate_netlink_event(device->pnp.device_class, acpi_bus_generate_netlink_event(device->pnp.device_class,
dev_name(&device->dev), event, 0); dev_name(&device->dev), event, 0);
break;
default: default:
ACPI_DEBUG_PRINT((ACPI_DB_INFO, ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Unsupported event [0x%x]\n", event)); "Unsupported event [0x%x]\n", event));
......
...@@ -1862,7 +1862,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) ...@@ -1862,7 +1862,7 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
cpuidle_drv = cpuidle_driver_ref(); cpuidle_drv = cpuidle_driver_ref();
if (!cpuidle_drv) { if (!cpuidle_drv) {
ret = -ENODEV; ret = -ENODEV;
goto out; goto err_drv;
} }
if (cpuidle_drv->state_count <= state) { if (cpuidle_drv->state_count <= state) {
ret = -EINVAL; ret = -EINVAL;
...@@ -1884,6 +1884,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state) ...@@ -1884,6 +1884,9 @@ int pm_genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state)
err: err:
cpuidle_driver_unref(); cpuidle_driver_unref();
err_drv:
kfree(cpu_data);
goto out; goto out;
} }
......
...@@ -328,6 +328,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb, ...@@ -328,6 +328,7 @@ static int __cpuinit cpufreq_stat_cpu_callback(struct notifier_block *nfb,
cpufreq_update_policy(cpu); cpufreq_update_policy(cpu);
break; break;
case CPU_DOWN_PREPARE: case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
cpufreq_stats_free_sysfs(cpu); cpufreq_stats_free_sysfs(cpu);
break; break;
case CPU_DEAD: case CPU_DEAD:
......
...@@ -1052,14 +1052,7 @@ static int powernowk8_target(struct cpufreq_policy *pol, ...@@ -1052,14 +1052,7 @@ static int powernowk8_target(struct cpufreq_policy *pol,
struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq, struct powernowk8_target_arg pta = { .pol = pol, .targfreq = targfreq,
.relation = relation }; .relation = relation };
/* return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
* Must run on @pol->cpu. cpufreq core is responsible for ensuring
* that we're bound to the current CPU and pol->cpu stays online.
*/
if (smp_processor_id() == pol->cpu)
return powernowk8_target_fn(&pta);
else
return work_on_cpu(pol->cpu, powernowk8_target_fn, &pta);
} }
/* Driver entry point to verify the policy and range of frequencies */ /* Driver entry point to verify the policy and range of frequencies */
......
...@@ -1083,7 +1083,8 @@ int flush_old_exec(struct linux_binprm * bprm) ...@@ -1083,7 +1083,8 @@ int flush_old_exec(struct linux_binprm * bprm)
bprm->mm = NULL; /* We're using it now */ bprm->mm = NULL; /* We're using it now */
set_fs(USER_DS); set_fs(USER_DS);
current->flags &= ~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD); current->flags &=
~(PF_RANDOMIZE | PF_FORKNOEXEC | PF_KTHREAD | PF_NOFREEZE);
flush_thread(); flush_thread();
current->personality &= ~bprm->per_clear; current->personality &= ~bprm->per_clear;
......
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