From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>,
"Claude Opus 4.6" <noreply@anthropic.com>
Subject: [PATCH master 4/4] of: overlay: initialize ret to fix garbage return value
Date: Mon, 16 Feb 2026 09:41:39 +0100 [thread overview]
Message-ID: <20260216084142.3546363-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20260216084142.3546363-1-a.fatoum@pengutronix.de>
If the FIT image has no valid overlay configuration nodes, the
for_each_child_of_node loop never executes and ret is returned
uninitialized. Initialize it to 0 since having no overlay
configurations to apply is not an error.
Reported-by: GCC 14.2 -fanalyzer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/of/overlay.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index d2cf2fa3f371..f0c3c783dd58 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -537,7 +537,7 @@ static int of_overlay_global_fixup_fit(struct device_node *root,
enum bootm_verify verify = bootm_get_verify_mode();
struct device_node *conf_node;
struct fit_handle *fit;
- int ret;
+ int ret = 0;
if (!IS_ENABLED(CONFIG_FITIMAGE)) {
pr_err("FIT based overlay handling requested while CONFIG_FITIMAGE=n\n");
--
2.47.3
prev parent reply other threads:[~2026-02-16 8:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-16 8:41 [PATCH master 1/4] FIT: fix potential uninitialized read during fuzzing Ahmad Fatoum
2026-02-16 8:41 ` [PATCH master 2/4] FIT: fix potential underflow of stack array Ahmad Fatoum
2026-02-16 8:41 ` [PATCH master 3/4] of: fdt: fix double free in fdt_ensure_space Ahmad Fatoum
2026-02-16 8:41 ` Ahmad Fatoum [this message]
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=20260216084142.3546363-4-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=noreply@anthropic.com \
/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