mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] scripts: imd: fix uninitialized variable read
@ 2020-04-29  6:40 Ahmad Fatoum
  2020-04-29  6:40 ` [PATCH 2/2] of: fix side effect in macro expansion Ahmad Fatoum
  2020-04-29  7:38 ` [PATCH 1/2] scripts: imd: fix uninitialized variable read Sascha Hauer
  0 siblings, 2 replies; 8+ messages in thread
From: Ahmad Fatoum @ 2020-04-29  6:40 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Errors are propagated in the loop and ret is never set. Remove it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 scripts/bareboximd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/scripts/bareboximd.c b/scripts/bareboximd.c
index b733cae61c87..d11b661fa391 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;
 }
 
-- 
2.26.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-05-04  7:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-29  6:40 [PATCH 1/2] scripts: imd: fix uninitialized variable read Ahmad Fatoum
2020-04-29  6:40 ` [PATCH 2/2] of: fix side effect in macro expansion Ahmad Fatoum
2020-04-29  8:00   ` Sascha Hauer
2020-04-29  8:26     ` Ahmad Fatoum
2020-04-29  8:41       ` Sascha Hauer
2020-04-29  8:47         ` Ahmad Fatoum
2020-04-29  7:38 ` [PATCH 1/2] scripts: imd: fix uninitialized variable read Sascha Hauer
2020-05-04  7:38   ` Steffen Trumtrar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox