Skip to content

Commit

Permalink
vmdk: Clean up bdrv_open_child() return value check
Browse files Browse the repository at this point in the history
bdrv_open_child() may return NULL.
Usually return value is checked for this function.
Check for return value is more reliable.

Fixes: 24bc15d ("vmdk: Use BdrvChild instead of BDS for references to extents")

Signed-off-by: Dmitry Frolov <frolov@swemel.ru>
Message-ID: <20230831125926.796205-1-frolov@swemel.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Dmitry Frolov authored and kevmw committed Sep 1, 2023
1 parent 45c2373 commit ff0d26d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block/vmdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
bs, &child_of_bds, extent_role, false,
&local_err);
g_free(extent_path);
if (local_err) {
if (!extent_file) {
error_propagate(errp, local_err);
ret = -EINVAL;
goto out;
Expand Down

0 comments on commit ff0d26d

Please sign in to comment.