summaryrefslogtreecommitdiff
path: root/block-vmdk.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:05:53 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2009-02-05 22:05:53 +0000
commit3ec88e80365c889f824d9a171fbf197b46a7c03f (patch)
treef0746a9234070ab3b86fd953827300eb21a0f7bb /block-vmdk.c
parent8a1d02aba9f986ca03d854184cd432ee98bcd179 (diff)
downloadqemu-3ec88e80365c889f824d9a171fbf197b46a7c03f.zip
block: remove error handling from qemu_malloc() callers (Avi Kivity)
Signed-off-by: Avi Kivity <avi@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6527 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-vmdk.c')
-rw-r--r--block-vmdk.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/block-vmdk.c b/block-vmdk.c
index eefd76beac..71d7504bda 100644
--- a/block-vmdk.c
+++ b/block-vmdk.c
@@ -276,8 +276,6 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file)
/* write RGD */
rgd_buf = qemu_malloc(gd_size);
- if (!rgd_buf)
- goto fail;
if (lseek(p_fd, rgd_offset, SEEK_SET) == -1)
goto fail_rgd;
if (read(p_fd, rgd_buf, gd_size) != gd_size)
@@ -290,8 +288,6 @@ static int vmdk_snapshot_create(const char *filename, const char *backing_file)
/* write GD */
gd_buf = qemu_malloc(gd_size);
- if (!gd_buf)
- goto fail_rgd;
if (lseek(p_fd, gd_offset, SEEK_SET) == -1)
goto fail_gd;
if (read(p_fd, gd_buf, gd_size) != gd_size)
@@ -430,8 +426,6 @@ static int vmdk_open(BlockDriverState *bs, const char *filename, int flags)
/* read the L1 table */
l1_size = s->l1_size * sizeof(uint32_t);
s->l1_table = qemu_malloc(l1_size);
- if (!s->l1_table)
- goto fail;
if (bdrv_pread(s->hd, s->l1_table_offset, s->l1_table, l1_size) != l1_size)
goto fail;
for(i = 0; i < s->l1_size; i++) {
@@ -440,8 +434,6 @@ static int vmdk_open(BlockDriverState *bs, const char *filename, int flags)
if (s->l1_backup_table_offset) {
s->l1_backup_table = qemu_malloc(l1_size);
- if (!s->l1_backup_table)
- goto fail;
if (bdrv_pread(s->hd, s->l1_backup_table_offset, s->l1_backup_table, l1_size) != l1_size)
goto fail;
for(i = 0; i < s->l1_size; i++) {
@@ -450,8 +442,6 @@ static int vmdk_open(BlockDriverState *bs, const char *filename, int flags)
}
s->l2_cache = qemu_malloc(s->l2_size * L2_CACHE_SIZE * sizeof(uint32_t));
- if (!s->l2_cache)
- goto fail;
return 0;
fail:
qemu_free(s->l1_backup_table);