Skip to content

Commit

Permalink
ACPI: power_meter: remove double kfree()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Darren Jenkins authored and Len Brown committed Jan 20, 2010
1 parent c19bdb6 commit 7f07a60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/acpi/power_meter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -740,7 +741,6 @@ static int setup_attrs(struct acpi_power_meter_resource *resource)

return res;
error:
remove_domain_devices(resource);
remove_attrs(resource);
return res;
}
Expand Down

0 comments on commit 7f07a60

Please sign in to comment.