diff mbox series

Fix warning in raw_handler

Message ID 20240129084055.13014-1-stefano.babic@swupdate.org
State Accepted
Headers show
Series Fix warning in raw_handler | expand

Commit Message

Stefano Babic Jan. 29, 2024, 8:40 a.m. UTC
handlers/raw_handler.c:253:27: warning: ‘cleanup_ret’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  253 |         return (ret ? ret : cleanup_ret);

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 handlers/raw_handler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/handlers/raw_handler.c b/handlers/raw_handler.c
index 4e9b3a43..00297622 100644
--- a/handlers/raw_handler.c
+++ b/handlers/raw_handler.c
@@ -153,7 +153,7 @@  static int install_raw_file(struct img_type *img,
 	char tmp_path[255];
 	int fdout = -1;
 	int ret = -1;
-	int cleanup_ret;
+	int cleanup_ret = 0;
 	int use_mount = (strlen(img->device) && strlen(img->filesystem)) ? 1 : 0;
 	char* DATADST_DIR = alloca(strlen(get_tmpdir())+strlen(DATADST_DIR_SUFFIX)+1);
 	sprintf(DATADST_DIR, "%s%s", get_tmpdir(), DATADST_DIR_SUFFIX);