mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/4] bootm: delete initrd reserve entry on bootm_boot return
Date: Wed, 21 Jan 2026 12:36:48 +0100	[thread overview]
Message-ID: <20260121113738.1485637-3-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260121113738.1485637-1-a.fatoum@pengutronix.de>

Repeating dry runs with an initrd will eventually lead to exhausting the
reserve memory entries as OF_MAX_RESERVE_MAP is only 16.

Make sure to clean up after ourselves if bootm_boot returns without
actually booting.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/bootm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/bootm.c b/common/bootm.c
index e3bd2eecb0cc..c554fa9e4015 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -1247,6 +1247,8 @@ int bootm_boot(struct bootm_data *bootm_data)
 err_out:
 	bootm_reset_overrides();
 	release_sdram_region(data->os_res);
+	if (data->initrd_res)
+		of_del_reserve_entry(data->initrd_res->start, data->initrd_res->end);
 	release_sdram_region(data->initrd_res);
 	release_sdram_region(data->oftree_res);
 	release_sdram_region(data->tee_res);
-- 
2.47.3




  parent reply	other threads:[~2026-01-21 11:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-21 11:36 [PATCH 1/4] of: fdt: implement of_del_reserve_entry Ahmad Fatoum
2026-01-21 11:36 ` [PATCH 2/4] ARM: sm: fix repeated call to of_add_reserve_entry on every fixup Ahmad Fatoum
2026-01-21 11:36 ` Ahmad Fatoum [this message]
2026-01-21 11:36 ` [PATCH 4/4] video: stmfb: add screen base only once Ahmad Fatoum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260121113738.1485637-3-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox