diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-05-27 17:35:51 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-20 10:25:01 +0200 |
commit | bcb6e3ca64d27b61fe41e479a968eb9734325903 (patch) | |
tree | 5d9a6d3f77d131399984a0ec11b4e4f542a3dcab /drivers/acpi/cppc_acpi.c | |
parent | 8641abcf0963ecb3b649e31e46cf2c6610c3493a (diff) | |
download | linux-rt-bcb6e3ca64d27b61fe41e479a968eb9734325903.tar.gz |
ACPI: CPPC: Fix reference count leak in acpi_cppc_processor_probe()
commit 4d8be4bc94f74bb7d096e1c2e44457b530d5a170 upstream.
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: 158c998ea44b ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/acpi/cppc_acpi.c')
-rw-r--r-- | drivers/acpi/cppc_acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/cppc_acpi.c b/drivers/acpi/cppc_acpi.c index 7bf1948b1223..732549ee1fe3 100644 --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -800,6 +800,7 @@ int acpi_cppc_processor_probe(struct acpi_processor *pr) "acpi_cppc"); if (ret) { per_cpu(cpc_desc_ptr, pr->id) = NULL; + kobject_put(&cpc_ptr->kobj); goto out_free; } |