[PATCH v2] boot: pxe_utils: Fix memory allocation issues in overlay_dir handling

Quentin Schulz quentin.schulz at cherry.de
Thu Nov 13 11:09:50 CET 2025


Hi Köry,

On 11/13/25 10:33 AM, Kory Maincent wrote:
> From: "Kory Maincent (TI.com)" <kory.maincent at bootlin.com>
> 
> Fix two memory allocation bugs in label_boot_extension():
> 
> 1. When label->fdtdir is not set, overlay_dir was used without any
>     memory allocation.
> 
> 2. When label->fdtdir is set, the allocation size was incorrect,
>     using 'len' (just the fdtdir length) instead of 'dir_len' (which
>     includes the trailing slash and null terminator).
> 
> Resolve both issues by moving the memory allocation and string
> formatting outside the conditional block, resulting in clearer code
> flow and correct sizing in all cases.
> 
> Closes: https://lists.denx.de/pipermail/u-boot/2025-November/602892.html
> Fixes: 935109cd9e97 ("boot: pxe_utils: Add extension board devicetree overlay support")
> Signed-off-by: Kory Maincent (TI.com) <kory.maincent at bootlin.com>

Acked-by: Quentin Schulz <quentin.schulz at cherry.de>

Thanks!
Quentin


More information about the U-Boot mailing list