Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2196157/?format=api
{ "id": 2196157, "url": "http://patchwork.ozlabs.org/api/patches/2196157/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260212213410.822845-1-james.hilliard1@gmail.com/", "project": { "id": 18, "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api", "name": "U-Boot", "link_name": "uboot", "list_id": "u-boot.lists.denx.de", "list_email": "u-boot@lists.denx.de", "web_url": null, "scm_url": null, "webscm_url": null, "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20260212213410.822845-1-james.hilliard1@gmail.com>", "list_archive_url": null, "date": "2026-02-12T21:34:09", "name": "[v6,1/1] image: fit: Apply overlays using aligned writable FDT copies", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "abe29ba0ccc702b3a716a605ae1e90bbc974e68c", "submitter": { "id": 66301, "url": "http://patchwork.ozlabs.org/api/people/66301/?format=api", "name": "James Hilliard", "email": "james.hilliard1@gmail.com" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260212213410.822845-1-james.hilliard1@gmail.com/mbox/", "series": [ { "id": 492042, "url": "http://patchwork.ozlabs.org/api/series/492042/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=492042", "date": "2026-02-12T21:34:09", "name": "[v6,1/1] image: fit: Apply overlays using aligned writable FDT copies", "version": 6, "mbox": "http://patchwork.ozlabs.org/series/492042/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2196157/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2196157/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<u-boot-bounces@lists.denx.de>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": "patchwork-incoming@legolas.ozlabs.org", "Authentication-Results": [ "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20230601 header.b=LqbhHxfW;\n\tdkim-atps=neutral", "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de", "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.b=\"LqbhHxfW\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "phobos.denx.de;\n spf=pass smtp.mailfrom=james.hilliard1@gmail.com" ], "Received": [ "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fBsSr133cz1xpY\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 13 Feb 2026 10:48:44 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 301D083AAB;\n\tFri, 13 Feb 2026 00:48:28 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id BC2B683015; Thu, 12 Feb 2026 22:34:33 +0100 (CET)", "from mail-ot1-x332.google.com (mail-ot1-x332.google.com\n [IPv6:2607:f8b0:4864:20::332])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 57E7780FA1\n for <u-boot@lists.denx.de>; Thu, 12 Feb 2026 22:34:31 +0100 (CET)", "by mail-ot1-x332.google.com with SMTP id\n 46e09a7af769-7d4c383f2fcso60473a34.0\n for <u-boot@lists.denx.de>; Thu, 12 Feb 2026 13:34:31 -0800 (PST)", "from james-x399.localdomain (71-218-105-26.hlrn.qwest.net.\n [71.218.105.26]) by smtp.gmail.com with ESMTPSA id\n 46e09a7af769-7d4a76f9483sm4886337a34.20.2026.02.12.13.34.28\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 12 Feb 2026 13:34:29 -0800 (PST)" ], "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de", "X-Spam-Level": "", "X-Spam-Status": "No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_GMAIL_RCVD,\n FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20230601; t=1770932070; x=1771536870; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=EXp0889hDb2Dn26MJ06U2PbpaDHOhvHxlWhfepZl/WQ=;\n b=LqbhHxfWWQWvy7OZf1ONYjbnXpNZnXWZwitWlFVakIHkDkrwXI6QkxUUhPjzGAqT4C\n OS0/8zJmOfNp/+fpUlnWi2/7nIFqnCl4yCsREX28sIVrZ+zfFBh1IPKm1ZrshrkaqReY\n 7RkLbWIqaSiPyy4TILfHIjSi1e1a3wjBGn2Jov7zG5YvCRGmkUkyo+HXu7sM+9orjhjq\n aSfTEXaI7YFMSx49eOIRZdsNt4akVsAYcPSrqvBSP/O4kVIjT3ghPyf4hCFppx/UJ0V1\n KeecC8i7tK6ZBbk/NJ7H78wUE++WGWRBfNybgS4jQt6GaitHs6kbKqJeqNN7KfsM2Y/T\n O++g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1770932070; x=1771536870;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=EXp0889hDb2Dn26MJ06U2PbpaDHOhvHxlWhfepZl/WQ=;\n b=sPUBq2XK08D70MasGTPlHHr0H+Cwi3Z5uAhZ3wsNDYh9m/VmeK25IW5bpEIYH518hF\n XqQrjnwwowogDUE6EaRoEtik4+LOhfrzKxYw7MmCEvAVKFn0Hc3rifsEFLqzLgyjxj+G\n e7VnqiFnVS/j88XjV/g6yePv2IGRFj88FXi+6hMAOHAxb56ypcJ1fe4jDf0LX1W9GvMW\n v+0CcJpW7L3WEtIlhImeG9Ph3S91AVBQv78SoOA0xl77viUmrcXNjfQqqly8NK81RIaW\n gQhO2uBuNlsiLalxHxbd4s3rHfuHUL4O5m0pDnQycLNStt3NAjbqdXhRTqJCSPueZi8/\n g0Rw==", "X-Gm-Message-State": "AOJu0Yyho+zgvP9dIOXSdb5UeE0CoqjVArswB6F4UCRj5Ht2RzCwaK7A\n pKwQuaNALTTQ0mNIMocEfl04yy6F3erR9IF3UGK9afHxXBQC+pE5GP/GNyoz4w==", "X-Gm-Gg": "AZuq6aLOE1Cs/cfzfp3FyiTmskP2GzC8OaV7H16VLGqS3g1lhUd3l7LY3u34tLogQvU\n lX9zSxbPo7BCzXjDO4g34Mo1DB8yb69fsykOY85dxEOWQXWTUnllecxZ1PZiJ3WIjnlvDZM6+Xo\n vh4paThF1rPcn1sLo5OTNxp6/a7xywdosbYFAdWMz9QnUi9qXZsdJsbvt6dCb9sJUG+50OK8VBS\n zmSxj7DhTe0LGs94yVQ2U6kOp40ht+0xPHzyJvDD1H/VMTXQws/D/0JkBqxuUPHGB2aQTzJGGVj\n pRMg3at/SlZMxzslepEdJGRslHfNxF5HpvixPZ68VaWx0bg4m/7rcaWazgHA6JNUZ6Xhh7r7Ex0\n 7NZ1iBVD9D8dvvulqoBrgEhjDnVFBsTHmTGPf8xTyahA6q2YmXYxOfBdWmztQD5vsD+ghfKTA0O\n fPnrdSWnmpqrgfPiJaDCJDAsyD+mTDlOzMFPJdz9knJztGBMVqbfkkmAYBiDx6BpnPXxL+houmV\n DgPwSIC9/GTdZLUuTU1vDgJXykaZtV3zNwDwHxSmgcCnlIY1LpxXjFxUmgU6nw=", "X-Received": "by 2002:a05:6830:348a:b0:7cf:e4a1:8b79 with SMTP id\n 46e09a7af769-7d4c2fe5e0dmr248316a34.7.1770932069721;\n Thu, 12 Feb 2026 13:34:29 -0800 (PST)", "From": "James Hilliard <james.hilliard1@gmail.com>", "To": "u-boot@lists.denx.de", "Cc": "James Hilliard <james.hilliard1@gmail.com>,\n Jamie Gibbons <Jamie.Gibbons@microchip.com>, Tom Rini <trini@konsulko.com>,\n Quentin Schulz <quentin.schulz@cherry.de>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n Wolfgang Wallner <wolfgang.wallner@at.abb.com>,\n David Lechner <dlechner@baylibre.com>", "Subject": "[PATCH v6 1/1] image: fit: Apply overlays using aligned writable FDT\n copies", "Date": "Thu, 12 Feb 2026 14:34:09 -0700", "Message-ID": "<20260212213410.822845-1-james.hilliard1@gmail.com>", "X-Mailer": "git-send-email 2.43.0", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-Mailman-Approved-At": "Fri, 13 Feb 2026 00:48:26 +0100", "X-BeenThere": "u-boot@lists.denx.de", "X-Mailman-Version": "2.1.39", "Precedence": "list", "List-Id": "U-Boot discussion <u-boot.lists.denx.de>", "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>", "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>", "List-Post": "<mailto:u-boot@lists.denx.de>", "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>", "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>", "Errors-To": "u-boot-bounces@lists.denx.de", "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>", "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de", "X-Virus-Status": "Clean" }, "content": "libfdt expects FDT/DTO blobs to be 8-byte aligned. When loading the\nbase FDT or overlays from a FIT, the mapped buffer may be unaligned,\nwhich can break fdt_open_into() on strict-alignment architectures.\n\nboot_get_fdt_fit() relocates the base FDT with boot_relocate_fdt()\nbefore applying overlays. That uses the bootm memory map and can\noverlap with the FIT buffer when the FIT is loaded into RAM,\ncorrupting data needed to load the kernel and ramdisk.\n\nAllocate writable, 8-byte aligned copies of the base FDT and overlays\nwith memalign() and fdt_open_into(). Grow the base buffer as needed,\napply overlays to it and pack the final tree. Free each temporary\noverlay copy after application and check fdt_pack() errors.\n\nFixes: 8fbcc0e0e839 (\"boot: Assure FDT is always 8-byte aligned\")\nFixes: 881f0b77dc8c (\"image: apply FDTOs on FDT image node\")\nSigned-off-by: James Hilliard <james.hilliard1@gmail.com>\nCc: Jamie Gibbons <Jamie.Gibbons@microchip.com>\n---\nChanges v1 -> v2:\n - also fix alignment issues\nChanges v2 -> v3:\n - do not print on -ENOMEM errors\n - let boot_get_fdt_fit_into_buffer() reuse buffers and handle rounding\nChanges v3 -> v4:\n - rebase on master\nChanges v4 -> v5:\n - refactor boot_get_fdt_fit_into_buffer() to use a single cleanup path\n and avoid duplicated free(tmp) handling\nChanges v5 -> v6:\n - add comment clarifying packed DTB size calculation and why this path\n should not use fdt_totalsize() for growth estimation\n---\n boot/image-fit.c | 165 ++++++++++++++++++++++++++++++++++++-----------\n 1 file changed, 126 insertions(+), 39 deletions(-)", "diff": "diff --git a/boot/image-fit.c b/boot/image-fit.c\nindex 3ed69b5f7bc..ddc64debb14 100644\n--- a/boot/image-fit.c\n+++ b/boot/image-fit.c\n@@ -2368,6 +2368,71 @@ int boot_get_setup_fit(struct bootm_headers *images, uint8_t arch,\n }\n \n #ifndef USE_HOSTCC\n+#ifdef CONFIG_OF_LIBFDT_OVERLAY\n+static int boot_get_fdt_fit_into_buffer(const void *src, ulong srclen,\n+\t\t\t\t\tulong extra, ulong min_dstlen,\n+\t\t\t\t\tvoid **fdtdstbuf, ulong *fdtdstlenp)\n+{\n+\tconst void *fdtsrcbuf;\n+\tvoid *tmp = NULL;\n+\tvoid *dstbuf, *newdstbuf = NULL;\n+\tulong dstlen, newdstlen;\n+\tint err = 0;\n+\n+\t/* Make sure the source FDT/DTO is 8-byte aligned for libfdt. */\n+\tfdtsrcbuf = src;\n+\tif (!IS_ALIGNED((uintptr_t)src, 8)) {\n+\t\ttmp = memalign(8, srclen);\n+\t\tif (!tmp)\n+\t\t\treturn -ENOMEM;\n+\n+\t\tmemcpy(tmp, src, srclen);\n+\t\tfdtsrcbuf = tmp;\n+\t}\n+\n+\tnewdstlen = ALIGN(fdt_totalsize(fdtsrcbuf) + extra, SZ_4K);\n+\tmin_dstlen = ALIGN(min_dstlen, SZ_4K);\n+\tif (newdstlen < min_dstlen)\n+\t\tnewdstlen = min_dstlen;\n+\n+\tdstbuf = *fdtdstbuf;\n+\tdstlen = dstbuf ? *fdtdstlenp : 0;\n+\n+\t/*\n+\t * If the caller already provided a large enough writable buffer,\n+\t * and we're not moving the FDT, nothing to do.\n+\t */\n+\tif (dstlen >= newdstlen && dstbuf == fdtsrcbuf)\n+\t\tgoto out;\n+\n+\t/* Try to reuse existing destination buffer if it is large enough. */\n+\tif (dstbuf && dstlen >= newdstlen) {\n+\t\terr = fdt_open_into(fdtsrcbuf, dstbuf, dstlen);\n+\t\tgoto out;\n+\t}\n+\n+\tnewdstbuf = memalign(8, newdstlen);\n+\tif (!newdstbuf) {\n+\t\terr = -ENOMEM;\n+\t\tgoto out;\n+\t}\n+\n+\terr = fdt_open_into(fdtsrcbuf, newdstbuf, newdstlen);\n+\tif (err < 0)\n+\t\tgoto out;\n+\n+\tfree(dstbuf);\n+\t*fdtdstbuf = newdstbuf;\n+\t*fdtdstlenp = newdstlen;\n+\tnewdstbuf = NULL;\n+\n+out:\n+\tfree(newdstbuf);\n+\tfree(tmp);\n+\treturn err;\n+}\n+#endif\n+\n int boot_get_fdt_fit(struct bootm_headers *images, ulong addr,\n \t\t const char **fit_unamep, const char **fit_uname_configp,\n \t\t int arch, ulong *datap, ulong *lenp)\n@@ -2380,18 +2445,12 @@ int boot_get_fdt_fit(struct bootm_headers *images, ulong addr,\n \tchar *next_config = NULL;\n \tulong load, len;\n #ifdef CONFIG_OF_LIBFDT_OVERLAY\n-\tulong ovload, ovlen, ovcopylen;\n+\tulong ovload, ovlen, ovcopylen, need;\n \tconst char *uconfig;\n \tconst char *uname;\n-\t/*\n-\t * of_flat_tree is storing the void * returned by map_sysmem, then its\n-\t * address is passed to boot_relocate_fdt which expects a char ** and it\n-\t * is then cast into a ulong. Setting its type to void * would require\n-\t * to cast its address to char ** when passing it to boot_relocate_fdt.\n-\t * Instead, let's be lazy and use void *.\n-\t */\n-\tchar *of_flat_tree;\n-\tvoid *base, *ov, *ovcopy = NULL;\n+\tvoid *ovcopy = NULL;\n+\tvoid *base_buf = NULL;\n+\tulong base_buf_size = 0;\n \tint i, err, noffset, ov_noffset;\n #endif\n \n@@ -2434,18 +2493,31 @@ int boot_get_fdt_fit(struct bootm_headers *images, ulong addr,\n \t/* we need to apply overlays */\n \n #ifdef CONFIG_OF_LIBFDT_OVERLAY\n-\t/* Relocate FDT so resizing does not overwrite other data in FIT. */\n-\tof_flat_tree = map_sysmem(load, len);\n-\tlen = ALIGN(fdt_totalsize(load), SZ_4K);\n-\terr = boot_relocate_fdt(&of_flat_tree, &len);\n-\tif (err) {\n-\t\tprintf(\"Required FDT relocation for applying DTOs failed: %d\\n\",\n-\t\t err);\n-\t\tfdt_noffset = -EBADF;\n+\t/*\n+\t * Make a writable copy of the base FDT for applying overlays.\n+\t *\n+\t * Do not use boot_relocate_fdt() here: it allocates from the bootm map and\n+\t * may overlap with the FIT buffer (still needed to load the kernel /\n+\t * ramdisk) when the FIT is loaded into RAM.\n+\t */\n+\terr = boot_get_fdt_fit_into_buffer(map_sysmem(load, len), len,\n+\t\t\t\t\t CONFIG_SYS_FDT_PAD, 0, &base_buf,\n+\t\t\t\t\t &base_buf_size);\n+\tif (err < 0) {\n+\t\tif (err != -ENOMEM)\n+\t\t\tprintf(\"Required FDT copy for applying DTOs failed: %s\\n\",\n+\t\t\t fdt_strerror(err));\n+\t\tfdt_noffset = err;\n \t\tgoto out;\n \t}\n \n-\tload = (ulong)of_flat_tree;\n+\t/*\n+\t * Track packed DTB data size (same as libfdt internal fdt_data_size_()).\n+\t * fdt_off_dt_strings() is an offset from the blob start, so this includes\n+\t * headers/reserve map/struct blocks. Do not use fdt_totalsize() here since\n+\t * it includes free space and would overestimate growth requirements.\n+\t */\n+\tlen = fdt_off_dt_strings(base_buf) + fdt_size_dt_strings(base_buf);\n \n \t/* apply extra configs in FIT first, followed by args */\n \tfor (i = 1; ; i++) {\n@@ -2489,48 +2561,61 @@ int boot_get_fdt_fit(struct bootm_headers *images, ulong addr,\n \t\t}\n \t\tdebug(\"%s loaded at 0x%08lx len=0x%08lx\\n\",\n \t\t\t\tuname, ovload, ovlen);\n-\t\tov = map_sysmem(ovload, ovlen);\n-\n-\t\tovcopylen = ALIGN(fdt_totalsize(ov), SZ_4K);\n-\t\tovcopy = malloc(ovcopylen);\n-\t\tif (!ovcopy) {\n-\t\t\tprintf(\"failed to duplicate DTO before application\\n\");\n-\t\t\tfdt_noffset = -ENOMEM;\n-\t\t\tgoto out;\n-\t\t}\n-\n-\t\terr = fdt_open_into(ov, ovcopy, ovcopylen);\n+\t\terr = boot_get_fdt_fit_into_buffer(map_sysmem(ovload, ovlen),\n+\t\t\t\t\t\t ovlen, 0, 0, &ovcopy,\n+\t\t\t\t\t\t &ovcopylen);\n \t\tif (err < 0) {\n-\t\t\tprintf(\"failed on fdt_open_into for DTO: %s\\n\",\n-\t\t\t fdt_strerror(err));\n+\t\t\tif (err != -ENOMEM)\n+\t\t\t\tprintf(\"failed on fdt_open_into for DTO: %s\\n\",\n+\t\t\t\t fdt_strerror(err));\n \t\t\tfdt_noffset = err;\n \t\t\tgoto out;\n \t\t}\n \n-\t\tbase = map_sysmem(load, len + ovlen);\n-\t\terr = fdt_open_into(base, base, len + ovlen);\n+\t\t/*\n+\t\t * Ensure the base FDT buffer is open and has enough room for\n+\t\t * the overlay. Grow it on demand.\n+\t\t */\n+\t\tneed = len + ovcopylen + CONFIG_SYS_FDT_PAD;\n+\t\terr = boot_get_fdt_fit_into_buffer(base_buf, base_buf_size, 0,\n+\t\t\t\t\t\t need, &base_buf,\n+\t\t\t\t\t\t &base_buf_size);\n \t\tif (err < 0) {\n-\t\t\tprintf(\"failed on fdt_open_into: %s\\n\",\n-\t\t\t fdt_strerror(err));\n+\t\t\tif (err != -ENOMEM)\n+\t\t\t\tprintf(\"failed to expand FDT for DTO application: %s\\n\",\n+\t\t\t\t fdt_strerror(err));\n \t\t\tfdt_noffset = err;\n \t\t\tgoto out;\n \t\t}\n \n \t\t/* the verbose method prints out messages on error */\n-\t\terr = fdt_overlay_apply_verbose(base, ovcopy);\n+\t\terr = fdt_overlay_apply_verbose(base_buf, ovcopy);\n \t\tif (err < 0) {\n \t\t\tfdt_noffset = err;\n \t\t\tgoto out;\n \t\t}\n-\t\tfdt_pack(base);\n-\t\tlen = fdt_totalsize(base);\n+\t\tlen = fdt_off_dt_strings(base_buf) + fdt_size_dt_strings(base_buf);\n+\n+\t\tfree(ovcopy);\n+\t\tovcopy = NULL;\n \t}\n+\n+\terr = fdt_pack(base_buf);\n+\tif (err < 0) {\n+\t\tfdt_noffset = err;\n+\t\tgoto out;\n+\t}\n+\tlen = fdt_totalsize(base_buf);\n #else\n \tprintf(\"config with overlays but CONFIG_OF_LIBFDT_OVERLAY not set\\n\");\n \tfdt_noffset = -EBADF;\n #endif\n \n out:\n+#ifdef CONFIG_OF_LIBFDT_OVERLAY\n+\tif (fdt_noffset >= 0 && base_buf)\n+\t\tload = map_to_sysmem(base_buf);\n+#endif\n \tif (datap)\n \t\t*datap = load;\n \tif (lenp)\n@@ -2541,6 +2626,8 @@ out:\n \t\t*fit_uname_configp = fit_uname_config;\n \n #ifdef CONFIG_OF_LIBFDT_OVERLAY\n+\tif (fdt_noffset < 0)\n+\t\tfree(base_buf);\n \tfree(ovcopy);\n #endif\n \tfree(fit_uname_config_copy);\n", "prefixes": [ "v6", "1/1" ] }