qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v1 18/59] qcow2-refcount.c: remove unneeded 'fail' label in qcow2


From: Daniel Henrique Barboza
Subject: [PATCH v1 18/59] qcow2-refcount.c: remove unneeded 'fail' label in qcow2_refcount_init()
Date: Mon, 6 Jan 2020 15:23:44 -0300

'fail' label can be replaced by 'return ret' and 'return -ENOMEM'
calls.

CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
CC: address@hidden
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 block/qcow2-refcount.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index f67ac6b2d8..1fe66677d1 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -111,22 +111,19 @@ int qcow2_refcount_init(BlockDriverState *bs)
 
     if (s->refcount_table_size > 0) {
         if (s->refcount_table == NULL) {
-            ret = -ENOMEM;
-            goto fail;
+            return -ENOMEM;
         }
         BLKDBG_EVENT(bs->file, BLKDBG_REFTABLE_LOAD);
         ret = bdrv_pread(bs->file, s->refcount_table_offset,
                          s->refcount_table, refcount_table_size2);
         if (ret < 0) {
-            goto fail;
+            return ret;
         }
         for(i = 0; i < s->refcount_table_size; i++)
             be64_to_cpus(&s->refcount_table[i]);
         update_max_refcount_table_index(s);
     }
     return 0;
- fail:
-    return ret;
 }
 
 void qcow2_refcount_close(BlockDriverState *bs)
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]