efi: Fix memory leak in efivar_ssdt_load
authorCyrill Gorcunov <gorcunov@gmail.com>
Mon, 4 Nov 2024 12:13:55 +0000 (15:13 +0300)
committerArd Biesheuvel <ardb@kernel.org>
Sun, 17 Nov 2024 07:54:02 +0000 (08:54 +0100)
commitc5d91b16f525ea8c98b3fd8efc5105106d17fe9a
tree7bf4ad69e75aefb783e307dab9288e8568295e7f
parent851062278436c9a887749e7b73598a28dd902ac0
efi: Fix memory leak in efivar_ssdt_load

When we load SSDT from efi variable (specified with efivar_ssdt=<var>
boot command line argument) a name for the variable is allocated
dynamically because we traverse all EFI variables. Unlike ACPI table
data, which is later used by ACPI engine, the name is no longer needed
once traverse is complete -- don't forget to free this memory.

Same time we silently ignore any errors happened here let's print a
message if something went wrong (but do not exit since this is not a
critical error and the system should continue to boot).

Also while here -- add a note why we keep SSDT table on success.

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/efi.c