aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-11-23 11:38:01 +0100
committerKevin Wolf <kwolf@redhat.com>2011-11-23 17:04:06 +0100
commit5bb1cbac4fdb1ca28f33c8d68538d03e3db7c160 (patch)
tree4765c56217762ff78ec60fc68644ff94f00173d1
parent6ac5f3881fd9880f55e30c5f5bd9984d9d47fd62 (diff)
vpc: Add missing error handling in alloc_block
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-rw-r--r--block/vpc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/block/vpc.c b/block/vpc.c
index 75d7d4ac77..89a5ee2668 100644
--- a/block/vpc.c
+++ b/block/vpc.c
@@ -362,8 +362,11 @@ static int64_t alloc_block(BlockDriverState* bs, int64_t sector_num)
// Initialize the block's bitmap
memset(bitmap, 0xff, s->bitmap_size);
- bdrv_pwrite_sync(bs->file, s->free_data_block_offset, bitmap,
+ ret = bdrv_pwrite_sync(bs->file, s->free_data_block_offset, bitmap,
s->bitmap_size);
+ if (ret < 0) {
+ return ret;
+ }
// Write new footer (the old one will be overwritten)
s->free_data_block_offset += s->block_size + s->bitmap_size;