]> git.baikalelectronics.ru Git - kernel.git/commit
ACPICA: Fix memory leak caused by _CID repair function
authorErik Kaneda <erik.kaneda@intel.com>
Fri, 4 Jun 2021 21:25:57 +0000 (14:25 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Jun 2021 12:04:42 +0000 (14:04 +0200)
commitdbac885b256df7845ed7930bc88fa539666968e1
treec026aa3595557962a1c1cd902edbd1954a47a1c0
parentbf97bc4bdbae3431a76583b70e240d3562860b97
ACPICA: Fix memory leak caused by _CID repair function

ACPICA commit 180cb53963aa876c782a6f52cc155d951b26051a

According to the ACPI spec, _CID returns a package containing
hardware ID's. Each element of an ASL package contains a reference
count from the parent package as well as the element itself.

Name (TEST, Package() {
    "String object" // this package element has a reference count of 2
})

A memory leak was caused in the _CID repair function because it did
not decrement the reference count created by the package. Fix the
memory leak by calling acpi_ut_remove_reference on _CID package elements
that represent a hardware ID (_HID).

Link: https://github.com/acpica/acpica/commit/180cb539
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Erik Kaneda <erik.kaneda@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpica/nsrepair2.c