qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix bdrv_open_child return value check
@ 2023-08-31 12:59 Dmitry Frolov
  2023-09-01 11:15 ` Kevin Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Frolov @ 2023-08-31 12:59 UTC (permalink / raw)
  To: qemu-devel, qemu-block, fam, kwolf, hreitz; +Cc: sdl.qemu, Dmitry Frolov

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>
---
 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.34.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix bdrv_open_child return value check
  2023-08-31 12:59 [PATCH] fix bdrv_open_child return value check Dmitry Frolov
@ 2023-09-01 11:15 ` Kevin Wolf
  2023-09-01 11:26   ` Дмитрий Фролов
  0 siblings, 1 reply; 4+ messages in thread
From: Kevin Wolf @ 2023-09-01 11:15 UTC (permalink / raw)
  To: Dmitry Frolov; +Cc: qemu-devel, qemu-block, fam, hreitz, sdl.qemu

Am 31.08.2023 um 14:59 hat Dmitry Frolov geschrieben:
> 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>

Did you actually see some failure because of this? If so, what is the
specific case that failed?

Or is this just cleanup based on code inspection?

Kevin



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix bdrv_open_child return value check
  2023-09-01 11:15 ` Kevin Wolf
@ 2023-09-01 11:26   ` Дмитрий Фролов
  2023-09-01 13:57     ` Kevin Wolf
  0 siblings, 1 reply; 4+ messages in thread
From: Дмитрий Фролов @ 2023-09-01 11:26 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: qemu-devel, qemu-block, fam, hreitz, sdl.qemu

Hello, Kevin.

This was just cleanup, based on the inspection.

Dmitry.

01.09.2023 14:15, Kevin Wolf пишет:
> Am 31.08.2023 um 14:59 hat Dmitry Frolov geschrieben:
>> 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>
> Did you actually see some failure because of this? If so, what is the
> specific case that failed?
>
> Or is this just cleanup based on code inspection?
>
> Kevin
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] fix bdrv_open_child return value check
  2023-09-01 11:26   ` Дмитрий Фролов
@ 2023-09-01 13:57     ` Kevin Wolf
  0 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2023-09-01 13:57 UTC (permalink / raw)
  To: Дмитрий Фролов
  Cc: qemu-devel, qemu-block, fam, hreitz, sdl.qemu

Am 01.09.2023 um 13:26 hat Дмитрий Фролов geschrieben:
> Hello, Kevin.
> 
> This was just cleanup, based on the inspection.

Thanks for clarifying. I've updated the subject line to "vmdk: Clean up
bdrv_open_child() return value check" to avoid misunderstandings and
applied this to my block branch.

Kevin



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-01 13:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-31 12:59 [PATCH] fix bdrv_open_child return value check Dmitry Frolov
2023-09-01 11:15 ` Kevin Wolf
2023-09-01 11:26   ` Дмитрий Фролов
2023-09-01 13:57     ` Kevin Wolf

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).