On 3/31/24 05:46, Armin Wolf wrote:
i thing the memory leak happens in acpi_ps_get_next_arg(). After allocating an acpi_parse_object in line 820 of psargs.c, calling of acpi_ps_get_next_namepath() fails due to to the missing symbol. The code now returns the error without freeing the acpi_parse_object, causing a memory leak. IMHO the solution would be to call acpi_ps_free_op() in case of an error before returning said error code. I attached an experimental patch which might fix this, but it is still untested. If you want you can test if it solves the problem.
This seems fixes the leak indeed (running upstream as of 026e680b0a08a62b1d948e5a8ca78700bfac0e6e). Feel free to resubmit with Tested-by: <me>, including the following if needed: Tested on HP ProBook 450 G8 Notebook PC (2X7X3EA#ABB), with 'dmidecode -t bios' as shown below: Vendor: HP Version: T87 Ver. 01.12.00 Release Date: 01/03/2023 Address: 0xF0000 Runtime Size: 64 kB ROM Size: 32 MB Characteristics: PCI is supported PC Card (PCMCIA) is supported BIOS is upgradeable BIOS shadowing is allowed Boot from CD is supported Selectable boot is supported EDD is supported Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) ACPI is supported USB legacy is supported Smart battery is supported BIOS boot specification is supported Function key-initiated network boot is supported Targeted content distribution is supported UEFI is supported BIOS Revision: 12.0 Firmware Revision: 84.22 Dmitry