[Concept,16/26] boot: pxe: Set pxe_file_size in extlinux_read_all()

Message ID 20260110202906.187370-17-sjg@u-boot.org
State New
Headers
Series boot: pxe: Add three-phase API and fix memory leaks |

Commit Message

Simon Glass Jan. 10, 2026, 8:28 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

The extlinux_read_all() function calls pxe_probe() with a config file
that is already loaded in bflow->buf. However, ctx->pxe_file_size is not
set, so the parser receives a size of 0 and fails.

Set ctx->pxe_file_size from bflow->size before calling pxe_probe().

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 boot/ext_pxe_common.c | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/boot/ext_pxe_common.c b/boot/ext_pxe_common.c
index 3b1412b86d3..930e54ea84d 100644
--- a/boot/ext_pxe_common.c
+++ b/boot/ext_pxe_common.c
@@ -136,6 +136,7 @@  int extlinux_read_all(struct udevice *dev, struct bootflow *bflow,
 	if (ret)
 		return log_msg_ret("era", ret);
 	addr = map_to_sysmem(bflow->buf);
+	plat->ctx.pxe_file_size = bflow->size;
 	ret = pxe_probe(&plat->ctx, addr, false);
 	if (ret)
 		return log_msg_ret("elb", -EFAULT);