Commit 7f07a605 authored by Darren Jenkins's avatar Darren Jenkins Committed by Len Brown

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: default avatarDarren Jenkins <darrenrjenkins@gmail.com>
Acked-by: default avatarDarrick J. Wong <djwong@us.ibm.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent c19bdb61
...@@ -534,6 +534,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource) ...@@ -534,6 +534,7 @@ static void remove_domain_devices(struct acpi_power_meter_resource *resource)
kfree(resource->domain_devices); kfree(resource->domain_devices);
kobject_put(resource->holders_dir); kobject_put(resource->holders_dir);
resource->num_domain_devices = 0;
} }
static int read_domain_devices(struct acpi_power_meter_resource *resource) static int read_domain_devices(struct acpi_power_meter_resource *resource)
...@@ -740,7 +741,6 @@ static int setup_attrs(struct acpi_power_meter_resource *resource) ...@@ -740,7 +741,6 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)
return res; return res;
error: error:
remove_domain_devices(resource);
remove_attrs(resource); remove_attrs(resource);
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment