aboutsummaryrefslogtreecommitdiff
path: root/block/vhdx-log.c
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2017-08-07 08:38:22 -0400
committerKevin Wolf <kwolf@redhat.com>2017-08-08 14:37:00 +0200
commit95d729835f3ceeed977eaf326a7ebb92788dee6d (patch)
treeee8da96392a78d031ba6f58535a8cee8a3259c69 /block/vhdx-log.c
parentc6572fa0d2b81bc3a9ca5716f975f2bf59c62e6c (diff)
block/vhdx: check error return of bdrv_truncate()
Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vhdx-log.c')
-rw-r--r--block/vhdx-log.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/block/vhdx-log.c b/block/vhdx-log.c
index a27dc059cd..14b724ef7b 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);