From d32aa3cae44e618048ff7f378577d44f9b6d6dcc Mon Sep 17 00:00:00 2001 From: Jordan Hand Date: Tue, 5 Mar 2019 14:47:56 -0800 Subject: fdt: Fix FIT header verification in mkimage and conduct same checks as bootm FIT header verification in mkimage was treating a return code as a boolean, which meant that failures in validating the fit were seen as successes. Additionally, mkimage was checking all formats to find a header which passes validation, rather than using the image type specified to mkimage. checkpatch.pl checks for lines ending with '(' and alignment matching open parentheses are ignored to keep with existing coding style. Signed-off-by: Jordan Hand --- tools/fit_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tools/fit_common.c') diff --git a/tools/fit_common.c b/tools/fit_common.c index d96085eaad..9506390214 100644 --- a/tools/fit_common.c +++ b/tools/fit_common.c @@ -26,7 +26,10 @@ int fit_verify_header(unsigned char *ptr, int image_size, struct image_tool_params *params) { - return fdt_check_header(ptr); + if (fdt_check_header(ptr) != EXIT_SUCCESS || !fit_check_format(ptr)) + return EXIT_FAILURE; + + return EXIT_SUCCESS; } int fit_check_image_types(uint8_t type) -- cgit v1.2.3