diff mbox series

[PULL,05/22] parallels: return earler in fail_format branch in parallels_open()

Message ID 20230920092108.258898-6-den@openvz.org (mailing list archive)
State New, archived
Headers show
Series [PULL,01/22] parallels: fix formatting in bdrv_parallels initialization | expand

Commit Message

Denis V. Lunev Sept. 20, 2023, 9:20 a.m. UTC
We do not need to perform any deallocation/cleanup if wrong format is
detected.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Reviewed-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
---
 block/parallels.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/block/parallels.c b/block/parallels.c
index ae006e7fc7..12f38cf70b 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -1232,7 +1232,8 @@  static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
 
 fail_format:
     error_setg(errp, "Image not in Parallels format");
-    ret = -EINVAL;
+    return -EINVAL;
+
 fail:
     /*
      * "s" object was allocated by g_malloc0 so we can safely