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 <[email protected]> Cc: 4.10+ <[email protected]> # 4.10+ Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 5c447c1 commit 4d8be4b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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)