(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

efi/libstub: Fix error unwind freeing fdt in allocate_new_fdt_and_exit_boot()

Sashiko says fdt_addr can point to either an allocated fdt or the fdt from get_fdt() which is memory owned by FW. Only the allocated fdt should be freed on the error unwind path. Use a dedicated variable for the allocation's size so that the free does not get confused. Fixes: 4fc8e738ff3e ("efi: libstub: remove DT dependency from generic stub") Reviewed-by: Jonathan Cameron <jonathan.cameron@oss.qualcomm.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>


Author Jason Gunthorpe Committer Ard Biesheuvel Date Commit Parent 1e50ed98
+4 -2
1 changed file
+4 -2
1 changed file