diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2020-04-29 08:40:39 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-04-29 09:29:49 +0200 |
commit | 9a08b99d266f6ca94e2e2859eb752fedbd8d6bd7 (patch) | |
tree | 27cc35754d3e729f59b991daf8d60d42f80abcde /scripts | |
parent | e75b084a61355788ffb1d6942ad84d1f449d1128 (diff) | |
download | barebox-9a08b99d266f6ca94e2e2859eb752fedbd8d6bd7.tar.gz barebox-9a08b99d266f6ca94e2e2859eb752fedbd8d6bd7.tar.xz |
scripts: imd: fix uninitialized variable read
Errors are propagated in the loop and ret is never set. Remove it.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/bareboximd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/scripts/bareboximd.c b/scripts/bareboximd.c index b733cae61c..d11b661fa3 100644 --- a/scripts/bareboximd.c +++ b/scripts/bareboximd.c @@ -53,7 +53,7 @@ int imd_command_setenv(const char *variable_name, const char *value) static int write_file(const char *filename, const void *buf, size_t size) { - int fd, ret; + int fd; int now; fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); @@ -74,9 +74,6 @@ static int write_file(const char *filename, const void *buf, size_t size) close(fd); - if (ret < 0) - return ret; - return 0; } |