From: Alistair Francis <[email protected]>

Signed-off-by: Alistair Francis <[email protected]>
---
 hw/core/loader.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/hw/core/loader.c b/hw/core/loader.c
index 590c5b02aa..73564a2a46 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -75,14 +75,20 @@ int64_t get_image_size(const char *filename, Error **errp)
 {
     int fd;
     int64_t size;
+
     fd = qemu_open(filename, O_RDONLY | O_BINARY, errp);
-    if (fd < 0)
+
+    if (fd < 0) {
         return -1;
+    }
+
     size = lseek(fd, 0, SEEK_END);
+
     if (size < 0) {
         error_setg_errno(errp, errno, "lseek failure: %s", filename);
         return -1;
     }
+
     close(fd);
     return size;
 }
-- 
2.51.0


Reply via email to