Patchwork [07/30] qcow: initialize coroutine mutex

login
register
mail settings
Submitter Kevin Wolf
Date Aug. 29, 2011, 2:53 p.m.
Message ID <1314629618-8308-8-git-send-email-kwolf@redhat.com>
Download mbox | patch
Permalink /patch/112087/
State New
Headers show

Comments

Kevin Wolf - Aug. 29, 2011, 2:53 p.m.
From: Scott Wood <scottwood@freescale.com>

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>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/qcow.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Patch

diff --git a/block/qcow.c b/block/qcow.c
index e155d3c..8f2bdfd 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: