Skip to content

Commit 4d8be4b

Browse files
QiushiWurafaeljw
authored andcommitted
ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe()
kobject_init_and_add() takes reference even when it fails. If this function returns an error, kobject_put() must be called to properly clean up the memory associated with the object. Previous commit "b8eb718348b8" fixed a similar problem. Fixes: 158c998 ("ACPI / CPPC: add sysfs support to compute delivered performance") Signed-off-by: Qiushi Wu <wu000273@umn.edu> Cc: 4.10+ <stable@vger.kernel.org> # 4.10+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 5c447c1 commit 4d8be4b

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/acpi/cppc_acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
846846
"acpi_cppc");
847847
if (ret) {
848848
per_cpu(cpc_desc_ptr, pr->id) = NULL;
849+
kobject_put(&cpc_ptr->kobj);
849850
goto out_free;
850851
}
851852

0 commit comments

Comments
 (0)