* [PATCH] ACPI processor: fix theoretical memleak
@ 2009-09-16 8:40 Alan Jenkins
0 siblings, 0 replies; only message in thread
From: Alan Jenkins @ 2009-09-16 8:40 UTC (permalink / raw)
To: Len Brown; +Cc: linux acpi
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
---
drivers/acpi/processor_core.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c
index 38ad5ef..0eb4a94 100644
--- a/drivers/acpi/processor_core.c
+++ b/drivers/acpi/processor_core.c
@@ -781,8 +781,8 @@ static int acpi_processor_add(struct acpi_device *device)
return -ENOMEM;
if (!zalloc_cpumask_var(&pr->throttling.shared_cpu_map, GFP_KERNEL)) {
- kfree(pr);
- return -ENOMEM;
+ result = -ENOMEM;
+ goto err_free_pr;
}
pr->handle = device->handle;
@@ -882,6 +882,8 @@ err_remove_fs:
acpi_processor_remove_fs(device);
err_free_cpumask:
free_cpumask_var(pr->throttling.shared_cpu_map);
+err_free_pr:
+ kfree(pr);
return result;
}
--
1.6.3.2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-16 8:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-16 8:40 [PATCH] ACPI processor: fix theoretical memleak Alan Jenkins
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.