summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAristo Chen <jj251510319013@gmail.com>2025-06-10 07:41:17 +0000
committerTom Rini <trini@konsulko.com>2025-06-26 08:12:54 -0600
commit21705d39144a51a50c0206c74588c6e9e4018e7a (patch)
tree770fdca091e99aa3e0c7000c67a861c6721d9caf
parentdf8dbc87a2570e99ba73d8e0a097797126040568 (diff)
tools: mkimage: propagate error codes from fit_handle_file()
The fit_handle_file() function previously returned a hardcoded -1 on error. This change updates the logic to return the actual error code stored in `ret`, allowing for error propagation. This improves debuggability and enables downstream callers to distinguish different failure causes, such as FDT_ERR_NOTFOUND or other errors. Signed-off-by: Aristo Chen <aristo.chen@canonical.com>
-rw-r--r--tools/fit_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/fit_image.c b/tools/fit_image.c
index caed8d5f901..3d2fbad3853 100644
--- a/tools/fit_image.c
+++ b/tools/fit_image.c
@@ -750,7 +750,7 @@ static int fit_handle_file(struct image_tool_params *params)
char bakfile[MKIMAGE_MAX_TMPFILE_LEN + 4] = {0};
char cmd[MKIMAGE_MAX_DTC_CMDLINE_LEN];
size_t size_inc;
- int ret;
+ int ret = EXIT_FAILURE;
/* Flattened Image Tree (FIT) format handling */
debug ("FIT format handling\n");
@@ -854,7 +854,7 @@ static int fit_handle_file(struct image_tool_params *params)
err_system:
unlink(tmpfile);
unlink(bakfile);
- return -1;
+ return ret;
}
/**