[PATCH v1 03/14] efi: loader: bootm: free the devicetree after installing it

Johannes Schneider johannes.schneider at leica-geosystems.com
Sat Oct 3 18:19:36 PDT 2026


bootm_get_devicetree() returns a buffer the caller has to free, and
efi_install_fdt() copies it into EFI memory. Free it once installed.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Johannes Schneider <johannes.schneider at leica-geosystems.com>
---
 efi/loader/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/efi/loader/bootm.c b/efi/loader/bootm.c
index a68db742e1..425e61fd70 100644
--- a/efi/loader/bootm.c
+++ b/efi/loader/bootm.c
@@ -245,7 +245,9 @@ static int efi_loader_bootm(struct image_data *data)
 		goto out;
 	}
 	if (fdt) {
+		/* efi_install_fdt() installs a copy */
 		ret = efi_install_fdt(fdt);
+		free(fdt);
 		if (ret)
 			goto out;
 	}
-- 
2.43.0




More information about the barebox mailing list