public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers/acpi/power_meter.c : remove double kfree()
@ 2010-01-12 12:37 Darren Jenkins
  2010-01-13 19:29 ` Darrick J. Wong
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Jenkins @ 2010-01-12 12:37 UTC (permalink / raw)
  To: djwong, lenb, linux-acpi, Kernel Janitors; +Cc: Linux Kernel Mailing List

resource->domain_devices can be double kfree()'d in a couple of places.
Fix this by setting num_domain_devices = 0 after the kfree().

Coverity CID: 13356, 13355, 13354

Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com> 

diff --git drivers/acpi/power_meter.c drivers/acpi/power_meter.c
index 2ef7030..18ce00a 100644
--- drivers/acpi/power_meter.c
+++ drivers/acpi/power_meter.c
@@ -534,6 +534,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource)
 
 	kfree(resource->domain_devices);
 	kobject_put(resource->holders_dir);
+	resource->num_domain_devices = 0;
 }
 
 static int read_domain_devices(struct acpi_power_meter_resource *resource)
@@ -740,7 +741,6 @@ skip_unsafe_cap:
 
 	return res;
 error:
-	remove_domain_devices(resource);
 	remove_attrs(resource);
 	return res;
 }



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-20  4:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-12 12:37 [PATCH] drivers/acpi/power_meter.c : remove double kfree() Darren Jenkins
2010-01-13 19:29 ` Darrick J. Wong
2010-01-20  4:56   ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox