diff mbox

qcow: initialize coroutine mutex

Message ID 20110811212715.GA28821@schlenkerla.am.freescale.net
State New
Headers show

Commit Message

Scott Wood Aug. 11, 2011, 9:27 p.m. UTC
commit 52b8eb60132b27ad53476490e9d7579003390cfa added a mutex,
but never initialized it.  This caused a segfault.

Reported-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 block/qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Kevin Wolf Aug. 12, 2011, 8:06 a.m. UTC | #1
Am 11.08.2011 23:27, schrieb Scott Wood:
> commit 52b8eb60132b27ad53476490e9d7579003390cfa added a mutex,
> but never initialized it.  This caused a segfault.
> 
> Reported-by: Alexander Graf <agraf@suse.de>
> Signed-off-by: Scott Wood <scottwood@freescale.com>

Thanks, applied to the block branch.

Kevin
diff mbox

Patch

diff --git a/block/qcow.c b/block/qcow.c
index 6447c2a..e46f15f 100644
--- a/block/qcow.c
+++ b/block/qcow.c
@@ -159,6 +159,8 @@  static int qcow_open(BlockDriverState *bs, int flags)
             goto fail;
         bs->backing_file[len] = '\0';
     }
+
+    qemu_co_mutex_init(&s->lock);
     return 0;
 
  fail: