mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 21:54:01 +00:00
tools: kwbimage: Check the return value of image_headersz_v1()
Function image_headersz_v1() may return zero on fatal errors. In this case the function already printed an error message. Check the return value of image_headersz_v1() in kwbimage_generate(), and exit on zero value with EXIT_FAILURE. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de>
This commit is contained in:
parent
0aca27ea18
commit
252e7c3a24
1 changed files with 4 additions and 0 deletions
|
@ -2029,6 +2029,10 @@ static int kwbimage_generate(struct image_tool_params *params,
|
|||
|
||||
case 1:
|
||||
alloc_len = image_headersz_v1(NULL);
|
||||
if (!alloc_len) {
|
||||
free(image_cfg);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue