From: Darren Jenkins Date: Tue, 12 Jan 2010 12:37:07 +0000 (+1100) Subject: ACPI: power_meter: remove double kfree() X-Git-Tag: v3.12-rc1~11510^2~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f07a605a3929d2d94dcbad8ccb7d280958d21f9;p=kernel%2Fkernel-generic.git ACPI: power_meter: remove double kfree() 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 Acked-by: Darrick J. Wong Signed-off-by: Len Brown --- diff --git a/drivers/acpi/power_meter.c b/drivers/acpi/power_meter.c index ca75c36..dc4ffad 100644 --- a/drivers/acpi/power_meter.c +++ b/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; }