efi/boot.c: add file.need_to_free
authorTrammell Hudson <hudson@trmm.net>
Fri, 2 Oct 2020 11:18:19 +0000 (07:18 -0400)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 9 Oct 2020 16:20:11 +0000 (17:20 +0100)
commit04be2c3a067899a3860fc2c7bc7a1599502ed1c5
tree16af0ce030ae2a4179c7a52b5a82eb3868a56720
parentafef39241b66df7d5fd66b07dc13350370a4991a
efi/boot.c: add file.need_to_free

The config file, kernel, initrd, etc should only be freed if they
are allocated with the UEFI allocator.  On x86 the ucode, and on
ARM the dtb, are also marked as need_to_free when allocated or
expanded.

This also fixes a memory leak in ARM fdt_increase_size() if there
is an error in building the new device tree.

Signed-off-by: Trammell Hudson <hudson@trmm.net>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/arm/efi/efi-boot.h
xen/arch/x86/efi/efi-boot.h
xen/common/efi/boot.c