From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: kwolf@redhat.com, qemu-devel@nongnu.org
Subject: [PULL 09/14] vmdk: Clean up bdrv_open_child() return value check
Date: Mon, 4 Sep 2023 16:36:38 +0200 [thread overview]
Message-ID: <20230904143643.259916-10-kwolf@redhat.com> (raw)
In-Reply-To: <20230904143643.259916-1-kwolf@redhat.com>
From: Dmitry Frolov <frolov@swemel.ru>
bdrv_open_child() may return NULL.
Usually return value is checked for this function.
Check for return value is more reliable.
Fixes: 24bc15d1f6 ("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>
---
block/vmdk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/vmdk.c b/block/vmdk.c
index 70066c2b01..58ce290e9c 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -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;
--
2.41.0
next prev parent reply other threads:[~2023-09-04 14:38 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 14:36 [PULL 00/14] Block layer patches Kevin Wolf
2023-09-04 14:36 ` [PULL 01/14] block/vpc: Avoid dynamic stack allocation Kevin Wolf
2023-09-04 14:36 ` [PULL 02/14] iotests: adapt test output for new qemu_cleanup() behavior Kevin Wolf
2023-09-04 14:36 ` [PULL 03/14] block: minimize bs->reqs_lock section in tracked_request_end() Kevin Wolf
2023-09-04 14:36 ` [PULL 04/14] block: change reqs_lock to QemuMutex Kevin Wolf
2023-09-04 14:36 ` [PULL 05/14] qemu-img: omit errno value in error message Kevin Wolf
2023-09-04 14:36 ` [PULL 06/14] block/iscsi: Document why we use raw malloc() Kevin Wolf
2023-09-04 14:36 ` [PULL 07/14] block: Be more verbose in create fallback Kevin Wolf
2023-09-04 14:36 ` [PULL 08/14] qemu-img: Update documentation for compressed images Kevin Wolf
2023-09-04 14:36 ` Kevin Wolf [this message]
2023-09-04 14:36 ` [PULL 10/14] block: remove AIOCBInfo->get_aio_context() Kevin Wolf
2023-09-04 14:36 ` [PULL 11/14] block-backend: process I/O in the current AioContext Kevin Wolf
2023-09-04 14:36 ` [PULL 12/14] block-backend: process zoned requests " Kevin Wolf
2023-09-04 14:36 ` [PULL 13/14] block: Remove bdrv_query_block_node_info Kevin Wolf
2023-09-04 14:36 ` [PULL 14/14] block: Remove unnecessary variable in bdrv_block_device_info Kevin Wolf
2023-09-06 15:13 ` [PULL 00/14] Block layer patches Stefan Hajnoczi
2023-09-07 8:17 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230904143643.259916-10-kwolf@redhat.com \
--to=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).