[08/13] installer: Fix use of uninitialized variable

Message ID 20240405125942.1803058-8-michael.tremer@ipfire.org
State Staged
Commit eb64913be183be3ce4fecf6c0b5270a2d1cd98d0
Headers
Series [01/13] installer: Update language files |

Commit Message

Michael Tremer April 5, 2024, 12:59 p.m. UTC
  Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 src/installer/hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/src/installer/hw.c b/src/installer/hw.c
index 039f8ac26..77c2d546e 100644
--- a/src/installer/hw.c
+++ b/src/installer/hw.c
@@ -132,11 +132,12 @@  static int strstartswith(const char* a, const char* b) {
 }
 
 static int setup_loop_device(const char* source, const char* device) {
+	int device_fd = -1;
+
 	int file_fd = open(source, O_RDWR);
 	if (file_fd < 0)
 		goto ERROR;
 
-	int device_fd = -1;
 	if ((device_fd = open(device, O_RDWR)) < 0)
 		goto ERROR;