[PATCH 2/2] state: don't use uninitialized variable

Juergen Borleis jbe at pengutronix.de
Thu Aug 17 02:32:33 PDT 2017


Printing 'ret' makes no sense.

Signed-off-by: Juergen Borleis <jbe at pengutronix.de>
---
 common/state/backend_storage.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 825db824b..c6ebe8624 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -214,7 +214,7 @@ static int mtd_get_meminfo(const char *path, struct mtd_info_user *meminfo)
 
 	fd = open(path, O_RDONLY);
 	if (fd < 0) {
-		pr_err("Failed to open '%s', %d\n", path, ret);
+		pr_err("Failed to open '%s', %d\n", path, fd);
 		return fd;
 	}
 
-- 
2.11.0




More information about the barebox mailing list