diff options
author | Hanjun Guo <guohanjun@huawei.com> | 2021-06-02 17:36:50 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-14 16:55:59 +0200 |
commit | c79852298ce7955508a22d9731dd7593887c313b (patch) | |
tree | 148d279f97d5fc38e9188d3b3aa19ea70512318e | |
parent | a8c0057aee14d763d76b8aefde81218e4589c6ce (diff) | |
download | kernel_replicant_linux-c79852298ce7955508a22d9731dd7593887c313b.tar.gz kernel_replicant_linux-c79852298ce7955508a22d9731dd7593887c313b.tar.bz2 kernel_replicant_linux-c79852298ce7955508a22d9731dd7593887c313b.zip |
ACPI: bus: Call kobject_put() in acpi_init() error path
[ Upstream commit 4ac7a817f1992103d4e68e9837304f860b5e7300 ]
Although the system will not be in a good condition or it will not
boot if acpi_bus_init() fails, it is still necessary to put the
kobject in the error path before returning to avoid leaking memory.
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | drivers/acpi/bus.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 1682f8b454a2..e317214aabec 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -1245,6 +1245,7 @@ static int __init acpi_init(void) result = acpi_bus_init(); if (result) { + kobject_put(acpi_kobj); disable_acpi(); return result; } |