qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-char: initialize chr_write_lock
@ 2014-06-26 11:45 Kirill Batuzov
  2014-06-26 11:47 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Kirill Batuzov @ 2014-06-26 11:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Nikita Belov, Paolo Bonzini, Luiz Capitulino, Fam Zheng,
	Kirill Batuzov

chr_write_lock was introduced in commit 9005b2a7589540a3733b3abdcfbccfe7746cd1a1
but was used uninitialized. It caused segmentation fault on windows hosts.

Add missing lock initialization to qemu_chr_alloc.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Fam Zheng <famz@redhat.com>
Signed-off-by: Kirill Batuzov <batuzovk@ispras.ru>
Signed-off-by: Nikita Belov <zodiac@ispras.ru>
---
 qemu-char.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/qemu-char.c b/qemu-char.c
index 2e50a10..17bd360 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -94,6 +94,7 @@ static QTAILQ_HEAD(CharDriverStateHead, CharDriverState) chardevs =
 CharDriverState *qemu_chr_alloc(void)
 {
     CharDriverState *chr = g_malloc0(sizeof(CharDriverState));
+    qemu_mutex_init(&chr->chr_write_lock);
     return chr;
 }
 
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-char: initialize chr_write_lock
  2014-06-26 11:45 [Qemu-devel] [PATCH] qemu-char: initialize chr_write_lock Kirill Batuzov
@ 2014-06-26 11:47 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-06-26 11:47 UTC (permalink / raw)
  To: Kirill Batuzov, qemu-devel; +Cc: Nikita Belov, Fam Zheng, Luiz Capitulino

Il 26/06/2014 13:45, Kirill Batuzov ha scritto:
> chr_write_lock was introduced in commit 9005b2a7589540a3733b3abdcfbccfe7746cd1a1
> but was used uninitialized. It caused segmentation fault on windows hosts.

A similar patch is already on the list.  Thanks anyway for your 
contribution!

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-26 11:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-26 11:45 [Qemu-devel] [PATCH] qemu-char: initialize chr_write_lock Kirill Batuzov
2014-06-26 11:47 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).