From: Aristo Chen Date: Tue, 10 Jun 2025 07:41:17 +0000 (+0000) Subject: tools: mkimage: propagate error codes from fit_handle_file() X-Git-Tag: v2025.10-rc1~91^2~35^2~4 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21705d39144a51a50c0206c74588c6e9e4018e7a;p=pandora-u-boot.git 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 --- 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; } /**