diff options
author | Darren Jenkins <darrenrjenkins@gmail.com> | 2010-01-12 07:37:07 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-01-19 23:56:02 -0500 |
commit | 7f07a605a3929d2d94dcbad8ccb7d280958d21f9 (patch) | |
tree | 0324eb959c005a4ba31d24c7e986f2a984c28616 | |
parent | c19bdb6126a5e1f43b4a4fc3c4b09c926667e5ef (diff) |
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>
-rw-r--r-- | drivers/acpi/power_meter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/acpi/power_meter.c b/drivers/acpi/power_meter.c index ca75c36f754c..dc4ffadf8122 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) | |||
534 | 534 | ||
535 | kfree(resource->domain_devices); | 535 | kfree(resource->domain_devices); |
536 | kobject_put(resource->holders_dir); | 536 | kobject_put(resource->holders_dir); |
537 | resource->num_domain_devices = 0; | ||
537 | } | 538 | } |
538 | 539 | ||
539 | static int read_domain_devices(struct acpi_power_meter_resource *resource) | 540 | static int read_domain_devices(struct acpi_power_meter_resource *resource) |
@@ -740,7 +741,6 @@ skip_unsafe_cap: | |||
740 | 741 | ||
741 | return res; | 742 | return res; |
742 | error: | 743 | error: |
743 | remove_domain_devices(resource); | ||
744 | remove_attrs(resource); | 744 | remove_attrs(resource); |
745 | return res; | 745 | return res; |
746 | } | 746 | } |