]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit - drivers/acpi/bus.c
ACPI: bus: Call kobject_put() in acpi_init() error path
authorHanjun Guo <guohanjun@huawei.com>
Wed, 2 Jun 2021 09:36:50 +0000 (17:36 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:30:13 +0000 (09:30 +0200)
commita34fa88feeb732859897faf0ba799c5d47c19e17
tree4dda652924c4ad7378fcb0f48da8f86eeb420af7
parent63cfad9836804cc2c82152df541c106a210b475a
ACPI: bus: Call kobject_put() in acpi_init() error path

BugLink: https://bugs.launchpad.net/bugs/1938340
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/acpi/bus.c