diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-09-30 09:19:56 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-10-02 05:59:55 +0200 |
commit | d52d80666a54b8fa5ae1d52506b9638c512f130e (patch) | |
tree | e92018ee3c1cc4b40bf750a2bc31d4e8fba790cf /commands | |
parent | 3f3b3c663a587bf67e2a6967c5935ed9d18503c4 (diff) | |
download | barebox-d52d80666a54b8fa5ae1d52506b9638c512f130e.tar.gz barebox-d52d80666a54b8fa5ae1d52506b9638c512f130e.tar.xz |
commands: uimage: fix indeterminate exit code of command
Depending on passed options, uimage may never assign ret a value.
Fix this by returning COMMAND_SUCCESS by default.
Reported-by: clang-analyzer-10
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands')
-rw-r--r-- | commands/uimage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/uimage.c b/commands/uimage.c index 982da7101a..fb4df780bd 100644 --- a/commands/uimage.c +++ b/commands/uimage.c @@ -19,7 +19,7 @@ static int uimage_flush(void *buf, unsigned int len) static int do_uimage(int argc, char *argv[]) { struct uimage_handle *handle; - int ret; + int ret = 0; int verify = 0; int fd; int opt; @@ -84,7 +84,7 @@ static int do_uimage(int argc, char *argv[]) err: uimage_close(handle); - return ret ? 1 : 0; + return ret ? COMMAND_ERROR : COMMAND_SUCCESS; } BAREBOX_CMD_HELP_START(uimage) |