From: Jeff Cody Date: Mon, 7 Aug 2017 12:38:22 +0000 (-0400) Subject: block/vhdx: check error return of bdrv_truncate() X-Git-Tag: v2.10.0-rc2~2^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95d729835f3ceeed977eaf326a7ebb92788dee6d;p=thirdparty%2Fqemu.git block/vhdx: check error return of bdrv_truncate() Signed-off-by: Jeff Cody Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- diff --git a/block/vhdx-log.c b/block/vhdx-log.c index a27dc059cdc..14b724ef7bc 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -558,7 +558,11 @@ static int vhdx_log_flush(BlockDriverState *bs, BDRVVHDXState *s, ret = -EINVAL; goto exit; } - bdrv_truncate(bs->file, new_file_size, PREALLOC_MODE_OFF, NULL); + ret = bdrv_truncate(bs->file, new_file_size, PREALLOC_MODE_OFF, + NULL); + if (ret < 0) { + goto exit; + } } } qemu_vfree(desc_entries);