summaryrefslogtreecommitdiff
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
authorHanjun Guo <guohanjun@huawei.com>2021-06-02 17:36:50 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2021-06-07 15:44:26 +0200
commit4ac7a817f1992103d4e68e9837304f860b5e7300 (patch)
tree849c2ae4fa14c123ea624d4649242df6eee4b759 /drivers/acpi/bus.c
parent9b64560134a0032d2de6bb565a76418ad90386fe (diff)
ACPI: bus: Call kobject_put() in acpi_init() error path
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>
Diffstat (limited to 'drivers/acpi/bus.c')
-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 a2e814a9ad99..c69470ec16b2 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -1330,6 +1330,7 @@ static int __init acpi_init(void)
result = acpi_bus_init();
if (result) {
+ kobject_put(acpi_kobj);
disable_acpi();
return result;
}