Skip to content

Commit 09e1508

Browse files
fenghusthurafaeljw
authored andcommitted
ACPI / utils: Fix memory leak in acpi_evaluate_reference() error path
When package.count is larger than ACPI_MAX_HANDLES, buffer.pointer is not freed before the function returns AE_NO_MEMORY. Fix this possible memory leak by kfree'ing it. Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 04ed510 commit 09e1508

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/acpi/utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,7 @@ acpi_evaluate_reference(acpi_handle handle,
355355
}
356356

357357
if (package->package.count > ACPI_MAX_HANDLES) {
358+
kfree(package);
358359
return AE_NO_MEMORY;
359360
}
360361
list->count = package->package.count;

0 commit comments

Comments
 (0)