Skip to content

Commit

Permalink
parallels: return earler in fail_format branch in parallels_open()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Denis V. Lunev committed Sep 20, 2023
1 parent 7aeb4a8 commit d6353f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion block/parallels.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6353f0

Please sign in to comment.