[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/10] qcow2: Put cache reference in error case
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 03/10] qcow2: Put cache reference in error case |
Date: |
Fri, 4 Apr 2014 21:27:42 +0200 |
When qcow2_get_cluster_offset() sees a zero cluster in a version 2
image, it (rightfully) returns an error. But in doing so it shouldn't
leak an L2 table cache reference.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block/qcow2-cluster.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 60a6910..331ab08 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -491,6 +491,7 @@ int qcow2_get_cluster_offset(BlockDriverState *bs, uint64_t
offset,
break;
case QCOW2_CLUSTER_ZERO:
if (s->qcow_version < 3) {
+ qcow2_cache_put(bs, s->l2_table_cache, (void**) &l2_table);
return -EIO;
}
c = count_contiguous_clusters(nb_clusters, s->cluster_size,
--
1.8.3.1
- [Qemu-devel] [PULL 00/10] Block patches for 2.0, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 02/10] qcow2: Flush metadata during read-only reopen, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 01/10] iscsi: Don't set error if already set in iscsi_do_inquiry, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 03/10] qcow2: Put cache reference in error case,
Kevin Wolf <=
- [Qemu-devel] [PULL 04/10] block: Don't parse 'filename' option, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 06/10] block: Fix snapshot=on for protocol parsed from filename, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 05/10] qemu-iotests: Remove CR line endings in reference output, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 08/10] dma-helpers: Initialize DMAAIOCB in_cancel flag, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 07/10] block: Check bdrv_getlength() return value in bdrv_append_temp_snapshot(), Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 09/10] iothread: make IOThread struct definition public, Kevin Wolf, 2014/04/04
- [Qemu-devel] [PULL 10/10] dataplane: replace iothread object_add() with embedded instance, Kevin Wolf, 2014/04/04
- Re: [Qemu-devel] [PULL 00/10] Block patches for 2.0, Peter Maydell, 2014/04/05