Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09e15086 authored by Xiongfeng Wang's avatar Xiongfeng Wang Committed by Rafael J. Wysocki
Browse files

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: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 04ed5109
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -355,6 +355,7 @@ acpi_evaluate_reference(acpi_handle handle,
	}

	if (package->package.count > ACPI_MAX_HANDLES) {
		kfree(package);
		return AE_NO_MEMORY;
	}
	list->count = package->package.count;