summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorHanjun Guo <guohanjun@huawei.com>2021-06-02 17:36:50 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:53:17 +0200
commit2238732f19926fc49e9d3e00e09da0e91da5e428 (patch)
tree72ca7301f259dc5dba709cb426eba0aa92b4ba6d /drivers/acpi
parent00f3017e04d42c6e2ae72254a92bf1b298942764 (diff)
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 54002670cb7a..bbd9c93fc4c2 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1240,6 +1240,7 @@ static int __init acpi_init(void)
result = acpi_bus_init();
if (result) {
+ kobject_put(acpi_kobj);
disable_acpi();
return result;
}