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 <darrenrjenkins@gmail.com>
Acked-by: Darrick J. Wong <djwong@us.ibm.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Darren Jenkins 2010-01-12 23:37:07 +11:00 committed by Len Brown
parent c19bdb6126
commit 7f07a605a3
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}