提交 4d8be4bc 编写于 作者: Q Qiushi Wu 提交者: Rafael J. Wysocki

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 "b8eb7183" fixed a similar problem.

Fixes: 158c998e ("ACPI / CPPC: add sysfs support to compute delivered performance")
Signed-off-by: NQiushi Wu <wu000273@umn.edu>
Cc: 4.10+ <stable@vger.kernel.org> # 4.10+
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
上级 5c447c18
...@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) ...@@ -846,6 +846,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr)
"acpi_cppc"); "acpi_cppc");
if (ret) { if (ret) {
per_cpu(cpc_desc_ptr, pr->id) = NULL; per_cpu(cpc_desc_ptr, pr->id) = NULL;
kobject_put(&cpc_ptr->kobj);
goto out_free; goto out_free;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册