Message ID | 22156.64847.849022.761752@mariner.uk.xensource.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/tools/blktap/drivers/block-qcow.c b/tools/blktap/drivers/block-qcow.c index 0e4e9cf..8fb6023 100644 --- a/tools/blktap/drivers/block-qcow.c +++ b/tools/blktap/drivers/block-qcow.c @@ -440,6 +440,7 @@ static uint64_t get_cluster_offset(struct tdqcow_state *s, if (posix_memalign((void **)&tmp_ptr, 4096, 4096) != 0) { DPRINTF("ERROR allocating memory for L1 table\n"); + return 0; } memcpy(tmp_ptr, l1_ptr, 4096); @@ -613,6 +614,7 @@ found: if (posix_memalign((void **)&tmp_ptr2, 4096, 4096) != 0) { DPRINTF("ERROR allocating memory for L1 table\n"); + return 0; } memcpy(tmp_ptr2, l2_ptr, 4096); lseek(s->fd, l2_offset + (l2_sector << 12), SEEK_SET);